Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: user_trailingslashit

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
34 function user_trailingslashit($string, $type_of_url = '') {
35      global $wp_rewrite;
36      if ( $wp_rewrite->use_trailing_slashes )
37           $string = trailingslashit($string);
38      else
39           $string = untrailingslashit($string);
40
41      // Note that $type_of_url can be one of following:
42      // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged, post_type_archive
43      $string = apply_filters('user_trailingslashit', $string, $type_of_url);
44      return $string;
45 }
46
47 /**
48  * Display permalink anchor for current post.
49  *
50  * The permalink mode title will use the post title for the 'a' element 'id'
51  * attribute. The id mode uses 'post-' with the post ID for the 'id' attribute.
52  *