redirect_canonical хук-фильтрWP 2.3.0

Filters the canonical redirect URL.

Returning false to this filter will cancel the redirect.

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

add_filter( 'redirect_canonical', 'wp_kama_redirect_canonical_filter', 10, 2 );

/**
 * Function for `redirect_canonical` filter-hook.
 * 
 * @param string $redirect_url  The redirect URL.
 * @param string $requested_url The requested URL.
 *
 * @return string
 */
function wp_kama_redirect_canonical_filter( $redirect_url, $requested_url ){

	// filter...
	return $redirect_url;
}
$redirect_url(строка)
The redirect URL.
$requested_url(строка)
The requested URL.

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

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

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

redirect_canonical()
redirect_canonical
wp-includes/canonical.php 791
$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );

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

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