Summery Summery

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

Syntax Syntax

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

Description Description

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

Parameters Parameters


(bool|string) Short-circuit return value. Either false or a URL string.


(int) Post ID, or 0 for the current post.


(string) The context for the link. One of 'post' or 'query',


(bool) Whether to allow post slugs in the shortlink.

Source Source

File: wp-includes/link-template.php


Changelog Changelog

Version Description
3.0.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.