pre_handle_404 filter-hook . WP 4.5.0
Filters whether to short-circuit default header status handling.
Returning a non-false value from the filter will short-circuit the handling and return early.
Usage
add_filter( 'pre_handle_404', 'filter_function_name_7839', 10, 2 ); function filter_function_name_7839( $preempt, $wp_query ){ // filter... return $preempt; }
- $preempt(true/false)
- Whether to short-circuit default header status handling.
Default: false - $wp_query(WP_Query)
- WordPress Query object.
Changelog
Since 4.5.0 | Introduced. |
Where the hook is called
pre_handle_404
wp-includes/class-wp.php 658
if ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) {
Where in WP core the hook is used WordPress
wp-includes/class-wp.php 77
add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );