From f1e01d188cdaf6ffbbeef2cd3b31f058b1315e1a Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Tue, 14 Feb 2023 15:57:21 +0000 Subject: [PATCH] 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 --- wp-includes/block-template.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/block-template.php b/wp-includes/block-template.php index 4d5742a4b9..9114e717eb 100644 --- a/wp-includes/block-template.php +++ b/wp-includes/block-template.php @@ -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' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3ef4f66226..655afe99cc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.