On this page
apply_filters( 'get_shortlink', string $shortlink, int $id, string $context, bool $allow_slugs )
Filters the shortlink for a post.
Parameters
$shortlinkstring-
Shortlink URL.
$idint-
Post ID, or 0 for the current post.
$contextstring-
The context for the link. One of
'post'or'query', $allow_slugsbool-
Whether to allow post slugs in the shortlink. Not used by default.
Source
File: wp-includes/link-template.php. View all references
return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
Related
Used By
| Used By | Description |
|---|---|
| wp_get_shortlink() wp-includes/link-template.php | Returns a shortlink for a post, page, attachment, or site. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_shortlink