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

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


Description

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


Parameters

$return

Short-circuit return value. Either false or a URL string.

$id

Post ID, or 0 for the current post.

$context

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

$allow_slugs

Whether to allow post slugs in the shortlink.


Source

File: wp-includes/link-template.php

View on GitHub



Changelog

Changelog
Version Description
WP-3.0.0 Introduced.