do_redirect_guess_404_permalink хук-фильтрWP 5.5.0

Filters whether to attempt to guess a redirect URL for a 404 request.

Returning a false value from the filter will disable the URL guessing and return early without performing a redirect.

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

add_filter( 'do_redirect_guess_404_permalink', 'wp_kama_do_redirect_guess_404_permalink_filter' );

/**
 * Function for `do_redirect_guess_404_permalink` filter-hook.
 * 
 * @param bool $do_redirect_guess Whether to attempt to guess a redirect URL for a 404 request.
 *
 * @return bool
 */
function wp_kama_do_redirect_guess_404_permalink_filter( $do_redirect_guess ){

	// filter...
	return $do_redirect_guess;
}
$do_redirect_guess(true|false)
Whether to attempt to guess a redirect URL for a 404 request.
По умолчанию: true

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

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

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

redirect_guess_404_permalink()
do_redirect_guess_404_permalink
wp-includes/canonical.php 931
if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) {

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

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