[wp-testers] post_class() function now returning IDs instead of slugs?

Dean Robinson dean.j.robinson at gmail.com
Fri May 22 11:15:07 GMT 2009


thanks Matt,

don't particularly like the change, but I can now see why it was changed

My issue was:

slug for "Category A" in production == slug for "Category A" in  
development
ID for "Category A" in production != ID for "Category A" in  
development  (in most cases)

no stress, I've already got a couple of workarounds in mind.

cheers

Dean Robinson
deanjrobinson.com

dean.j.robinson at gmail.com
http://twitter.com/deanjrobinson

http://hahlo.com
dean at hahlo.com
http://twitter.com/hahlo

On 22/05/2009, at 9:01 PM, Matt Martz wrote:

> On Fri, May 22, 2009 at 6:47 AM, Dean Robinson
> <dean.j.robinson at gmail.com> wrote:
>> Just installed a copy of 2.8 beta1 locally for some dev work and  
>> noticed
>> that a bunch of styles in my current theme no longer worked.
>>
>> A bit of investigation tracked it back to the post_class()  
>> function, which
>> previously returned something like "category-article" etc (using the
>> category slug), but now appears to have been changed to return  
>> classes based
>> on the ID of the category instead, eg "category-107".
>>
>> Did a quick search and couldn't find anything around why this might  
>> of been
>> changed, or if its a bug or not.
>>
>> Personally I prefer "category-slug" to "category-ID" it seems more  
>> logical
>> and easier to make use of, but perhaps it was changed for a good  
>> reason, can
>> anyone shed some light on this?
>>
>> Looks like this was first changed in revision 11300 (10 days ago)
>
> I believe that change actually happened in 11306
> (http://core.trac.wordpress.org/changeset/11306).
>
> The commit message was "Use IDs instead of slugs in CSS classes ro
> avoid invalid class names. Props hakre. fixes #8446"
>
> The referenced ticket is http://core.trac.wordpress.org/ticket/8446
> -- 
> Matt Martz
> matt at sivel.net
> http://sivel.net/
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers



More information about the wp-testers mailing list