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. Built from https://develop.svn.wordpress.org/trunk@55335 git-svn-id: http://core.svn.wordpress.org/trunk@54868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6e59ccc47e
commit
f1e01d188c
|
@ -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' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.2-beta1-55334';
|
$wp_version = '6.2-beta1-55335';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue