pre_redirect_guess_404_permalink filter-hookWP 5.5.0

Short-circuits the redirect URL guessing for 404 requests.

Returning a non-null value from the filter will effectively short-circuit the URL guessing, returning the passed value instead.

Usage

add_filter( 'pre_redirect_guess_404_permalink', 'wp_kama_pre_redirect_guess_404_permalink_filter' );

/**
 * Function for `pre_redirect_guess_404_permalink` filter-hook.
 * 
 * @param null|string|false $pre Whether to short-circuit guessing the redirect for a 404.
 *
 * @return null|string|false
 */
function wp_kama_pre_redirect_guess_404_permalink_filter( $pre ){

	// filter...
	return $pre;
}
$pre(null|string|false)
Whether to short-circuit guessing the redirect for a 404.
Default: null to continue with the URL guessing

Changelog

Since 5.5.0 Introduced.

Where the hook is called

redirect_guess_404_permalink()
pre_redirect_guess_404_permalink
wp-includes/canonical.php 915
$pre = apply_filters( 'pre_redirect_guess_404_permalink', null );

Where the hook is used in WordPress

Usage not found.