A WordPress-centric search engine for devs and theme authors

pre_get_shortlink ›

apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs )
Parameters: (4)
  • (false|string) $return Short-circuit return value. Either false or a URL string.
    Required: Yes
  • (int) $id Post ID, or 0 for the current post.
    Required: Yes
  • (string) $context The context for the link. One of 'post' or 'query',
    Required: Yes
  • (bool) $allow_slugs Whether to allow post slugs in the shortlink.
    Required: Yes
Defined at:

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

Returning a truthy value from the filter will effectively short-circuit the shortlink generation process, returning that value instead.


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