pre_get_shortlink

pre_get_shortlink

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('pre_get_shortlink') is found 1 times:

  • /wp-includes/link-template.php line 4159
    4155
    4156
    4157
    4158
    4159
    4160
    4161
    4162
    4163
    4164
    4165
    * @param int          $id          Post ID, or 0 for the current post.
     * @param string       $context     The context for the link. One of 'post' or 'query',
     * @param bool         $allow_slugs Whether to allow post slugs in the shortlink.
     */
    $shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs );
     
    if ( false !== $shortlink ) {
        return $shortlink;
    }
     
    $post_id = 0;

See this hook used in plugins: