apply_filters( 'pre_handle_404', bool $preempt, WP_Query $wp_query )
- Since
- 4.5.0
Filters whether to short-circuit default header status handling.
Description
Returning a non-false value from the filter will short-circuit the handling and return early.
Compatibility
- WordPress
- since 4.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$preemptbool- Whether to short-circuit default header status handling. Default false.
$wp_queryWP_Query- WordPress Query object.
Where this hook fires · 1
wp-includes/class-wp.php:735WP::handle_404()
Source code
* * @since 4.5.0 * * @param bool $preempt Whether to short-circuit default header status handling. Default false. * @param WP_Query $wp_query WordPress Query object. */ if ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) { return; } // If we've already issued a 404, bail. if ( is_404() ) { return;Changelog
Introduced in 4.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.