page_link хук-фильтрWP 1.5.0

Filters the permalink for a page.

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

add_filter( 'page_link', 'wp_kama_page_link_filter', 10, 3 );

/**
 * Function for `page_link` filter-hook.
 * 
 * @param string $link    The page's permalink.
 * @param int    $post_id The ID of the page.
 * @param bool   $sample  Is it a sample permalink.
 *
 * @return string
 */
function wp_kama_page_link_filter( $link, $post_id, $sample ){

	// filter...
	return $link;
}
$link(строка)
The page's permalink.
$post_id(int)
The ID of the page.
$sample(true|false)
Is it a sample permalink.

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

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

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

get_page_link()
page_link
wp-includes/link-template.php 409
return apply_filters( 'page_link', $link, $post->ID, $sample );

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

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