[wp-hackers] Proposed: the_category() - improved separator flexibilty

Mark Jaquith mark.wordpress at txfx.net
Mon Oct 11 21:21:08 UTC 2004


Dennis Williamson wrote:

> I've attached a diff that makes some changes to the_category() in 
> template-functions-category.php CVS revision 1.39..
>
> It changes the handling of $seperator to improve flexibility to the 
> user. Calls to the_category() can specify a separator including spaces 
> or not.
>
> Examples:
>
>     the_category('/'); produces Blog/Category
>
>     the_category(" / "); produces Blog / Category
>
> Before, the spaces were hard-coded in the function and couldn't be 
> overridden. 

Good call!  That was one of the first WP hacks I ever did... I wanted to 
display:    "Category1" :: "Category2" :: "Category3"           but 
couldn't, because of the spaces.

I think that in general, spaces shouldn't be assumed.  It is far too 
limiting.



More information about the hackers mailing list