pre_redirect_guess_404_permalink хук-фильтрWP 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.

Использование

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|строка|false)
Whether to short-circuit guessing the redirect for a 404.
По умолчанию: null to continue with the URL guessing

Список изменений

С версии 5.5.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.