Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_shortlink

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
4147       * Filters the shortlink for a post.
4148       *
4149       * @since 3.0.0
4150       *
4151       * @param string $shortlink   Shortlink URL.
4152       * @param int    $id          Post ID, or 0 for the current post.
4153       * @param string $context     The context for the link. One of 'post' or 'query',
4154       * @param bool   $allow_slugs Whether to allow post slugs in the shortlink. Not used by default.
4155       */
4156      return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs );
4157 }
4158
4159 /**
4160  * Injects rel=shortlink into the head if a shortlink is defined for the current page.
4161  *
4162  * Attached to the {@see 'wp_head'} action.
4163  *
4164  * @since 3.0.0
4165  */