WordPress at Your Fingertips
filter is not described

pre_get_shortlink filter-hook . WP 3.0.0

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.


add_filter( 'pre_get_shortlink', 'filter_function_name_726', 10, 4 );
function filter_function_name_726( $return, $id, $context, $allow_slugs ){
	// filter...

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


Since 3.0.0 Introduced.

Where the hook is called

wp-includes/link-template.php 3957
$shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );

Where in WP core the hook is used WordPress

Usage not found.