wordpress / latest / hooks / pre_get_shortlink.html

apply_filters( 'pre_get_shortlink', false|string $return, int $id, string $context, bool $allow_slugs )

Filters whether to preempt generating a shortlink for the given post.

Description

Returning a value other than false from the filter will short-circuit the shortlink generation process, returning that value instead.

Parameters

$return false|string
Short-circuit return value. Either false or a URL string.
$id int
Post ID, or 0 for the current post.
$context string
The context for the link. One of 'post' or 'query',
$allow_slugs bool
Whether to allow post slugs in the shortlink.

Source

File: wp-includes/link-template.php. View all references

$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );

Used By

Used By Description

Changelog

Version Description
3.0.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_get_shortlink