From f5550907e17a7ab227cf51b2a74035535b1f0b88 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 26 Mar 2020 17:41:14 +0000 Subject: [PATCH] Query: Introduce an action which gets fired when a 404 is triggered. Fixes #48061 git-svn-id: https://develop.svn.wordpress.org/trunk@47509 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-query.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 540201552c..a36531e350 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/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 ) ); } /**