From 33d4f0573c0d280c609fca9f483873f21661988d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 26 Mar 2020 17:43:07 +0000 Subject: [PATCH] Query: Introduce an action which gets fired when a 404 is triggered. Fixes #48061 Built from https://develop.svn.wordpress.org/trunk@47509 git-svn-id: http://core.svn.wordpress.org/trunk@47284 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 9 +++++++++ wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 540201552c..a36531e350 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -1711,6 +1711,15 @@ class WP_Query { $this->is_404 = true; $this->is_feed = $is_feed; + + /** + * Fires after a 404 is triggered. + * + * @since 5.5.0 + * + * @param WP_Query $this The WP_Query instance (passed by reference). + */ + do_action_ref_array( 'set_404', array( $this ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 48b62d863b..9f3affe522 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47508'; +$wp_version = '5.5-alpha-47509'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.