[wp-hackers] user_trailingslashit()?

Mike Schinkel mikeschinkel at newclarity.net
Tue Dec 8 06:11:54 UTC 2009


Okay, Thanks. 

Maybe I'm just confused by some carelessly written code?  For example, why do this?

>          $link = trailingslashit(get_bloginfo('home')) . str_replace('%pagename%', $post_type['plural'] . '/' . $post->post_name, $permastruct);
>          $link = user_trailingslashit($link);

Why not just:

         $link =user_trailingslashit(get_bloginfo('home')) . str_replace('%pagename%', $post_type['plural'] . '/' . $post->post_name, $permastruct);

-Mike


On Dec 8, 2009, at 1:02 AM, Austin Matzko wrote:

> On Mon, Dec 7, 2009 at 11:57 PM, Mike Schinkel
> <mikeschinkel at newclarity.net> wrote:
>> So here's another question; what exactly is user_trailingslashit() for and how are they supposed to be used?  Google is decidedly *not* my friend here and reading the code does me little better.
> 
> One blog might want the permalink structure to be
> 
> /%year%/%monthnum%/%day%/%postname%/  (trailing slash)
> 
> another might want instead
> 
> /%year%/%monthnum%/%day%/%postname%  (no trailing slash).
> 
> user_trailingslashit() makes whatever URL you pass to it consistent
> with that preference as set in Settings > Permalinks.
> 
> Does that make sense?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list