page_link
Filters the permalink for a page.
Usage
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(string)
- The page's permalink.
- $post_id(int)
- The ID of the page.
- $sample(true|false)
- Is it a sample permalink.
Changelog
| Since 1.5.0 | Introduced. |
Where the hook is called
page_link
wp-includes/link-template.php 409
return apply_filters( 'page_link', $link, $post->ID, $sample );