mirror of
git://develop.git.wordpress.org/
synced 2025-02-06 23:50:43 +01:00
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:
parent
c7e7a0b056
commit
2730dfa902
@ -27,7 +27,7 @@ function _add_template_loader_filters() {
|
|||||||
|
|
||||||
// Request to resolve a template.
|
// Request to resolve a template.
|
||||||
if ( isset( $_GET['_wp-find-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' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user