
如何在WordPress中使用Bootstrap图标?
user_trailingslashit ( $string, $type_of_url = '' )
如果网站设置了添加尾部斜杠的功能,则检索一个尾部斜杠字符串。
如果固定链接结构有尾部斜线,则有条件地添加尾部斜线,如果没有则删除尾部斜线。该字符串会通过{@see ‘user_trailingslashit’}过滤器。如果网站没有设置尾部斜杠,将从字符串中删除尾部斜杠。
function user_trailingslashit( $string, $type_of_url = '' ) { global $wp_rewrite; if ( $wp_rewrite->use_trailing_slashes ) { $string = trailingslashit( $string ); } else { $string = untrailingslashit( $string ); } /** * Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes. * * @since 2.2.0 * * @param string $string URL with or without a trailing slash. * @param string $type_of_url The type of URL being considered. Accepts 'single', 'single_trackback', * 'single_feed', 'single_paged', 'commentpaged', 'paged', 'home', 'feed', * 'category', 'page', 'year', 'month', 'day', 'post_type_archive'. */ return apply_filters( 'user_trailingslashit', $string, $type_of_url ); }