Definition:
function user_trailingslashit($string, $type_of_url = '') {}
Retrieve trailing slash string, if blog set for adding trailing slashes.
Conditionally adds a trailing slash if the permalink structure has a trailing slash, strips the trailing slash if not. The string is passed through the ‘user_trailingslashit’ filter. Will remove trailing slash from string, if blog is not set to have them.
Parameters
- string $string: URL with or without a trailing slash.
- string $type_of_url: The type of URL being considered (e.g. single, category, etc) for use in the filter.
Defined filters
- user_trailingslashit
apply_filters('user_trailingslashit', $string, $type_of_url)
Source code
function user_trailingslashit($string, $type_of_url = '') { global $wp_rewrite; if ( $wp_rewrite->use_trailing_slashes ) $string = trailingslashit($string); else $string = untrailingslashit($string); // Note that $type_of_url can be one of following: // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged, post_type_archive $string = apply_filters('user_trailingslashit', $string, $type_of_url); return $string; }
3303
No comments yet... Be the first to leave a reply!