get_shortlink filter-hook . WP 3.0.0
Filters the shortlink for a post.
Usage
add_filter( 'get_shortlink', 'filter_function_name_6530', 10, 4 ); function filter_function_name_6530( $shortlink, $id, $context, $allow_slugs ){ // filter... return $shortlink; }
- $shortlink(string)
- Shortlink URL.
- $id(int)
- Post ID, or 0 for the current post.
- $context(string)
- The context for the link. One of 'post' or 'query',
- $allow_slugs(true/false)
- Whether to allow post slugs in the shortlink. Not used by default.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
get_shortlink
wp-includes/link-template.php 3936
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );