Source View: the_permalink

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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
13  */
14 function the_permalink() {
15      /**
16       * Filter the display of the permalink for the current post.
17       *
18       * @since 1.5.0
19       *
20       * @param string $permalink The permalink for the current post.
21       */
22      echo esc_url( apply_filters( 'the_permalink', get_permalink() ) );
23 }
24
25 /**
26  * Retrieve trailing slash string, if blog set for adding trailing slashes.
27  *
28  * Conditionally adds a trailing slash if the permalink structure has a trailing
29  * slash, strips the trailing slash if not. The string is passed through the
30  * 'user_trailingslashit' filter. Will remove trailing slash from string, if
31  * blog is not set to have them.