Themes: Use add_action for pre_get_posts hook in _add_template_loader_filters().

Although `add_action` and `add_filter` are internally the same, `pre_get_posts` is an action hook.  This change updates the hook type to match what developers would expect when evaluating the code.

Follow-up to [52316].

Props swissspidy, riccardodicurti.
Fixes #57097.

git-svn-id: https://develop.svn.wordpress.org/trunk@55335 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
David Baumwald 2023-02-14 15:55:05 +00:00
parent c7e7a0b056
commit 2730dfa902

View File

@ -27,7 +27,7 @@ function _add_template_loader_filters() {
// Request to resolve a template.
if ( isset( $_GET['_wp-find-template'] ) ) {
add_filter( 'pre_get_posts', '_resolve_template_for_new_post' );
add_action( 'pre_get_posts', '_resolve_template_for_new_post' );
}
}