pre_handle_404 WordPress Filter Hook

The pre_handle_404 hook is called before WordPress attempts to handle a 404 error. This hook can be used to perform custom redirects or to modify the default behavior.

apply_filters( 'pre_handle_404', bool $preempt, WP_Query $wp_query ) #

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.


Top ↑

Parameters

$preempt

(bool)Whether to short-circuit default header status handling. Default false.

$wp_query

(WP_Query)WordPress Query object.


Top ↑

Source

File: wp-includes/class-wp.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.