_get_page_link
Filters the permalink for a non-page_on_front page.
Использование
add_filter( '_get_page_link', 'wp_kama__get_page_link_filter', 10, 2 );
/**
* Function for `_get_page_link` filter-hook.
*
* @param string $link The page's permalink.
* @param int $post_id The ID of the page.
*
* @return string
*/
function wp_kama__get_page_link_filter( $link, $post_id ){
// filter...
return $link;
}
- $link(строка)
- The page's permalink.
- $post_id(int)
- The ID of the page.
Список изменений
| С версии 2.1.0 | Введена. |
Где вызывается хук
_get_page_link
wp-includes/link-template.php 456
return apply_filters( '_get_page_link', $link, $post->ID );