[wp-testers] 3.01 wp_nav_menu broke my theme

Andrew Nacin wp at andrewnacin.com
Sat Aug 21 06:55:46 UTC 2010


On Sat, Aug 21, 2010 at 2:22 AM, Bruce Wampler <brucewampler at gmail.com>wrote:

>  I just discovered a problem:  the return string from wp_nav_menu in 3.01
> is
> not the same as 3.0, and the difference broke my theme. For some reason,
> 3.01 decided to supply each menu item's id as both an ID to the li and
> as a class in the class=''. E.g., menu-item-24 below.
>
> <li id="menu-item-24" class="menu-item menu-item-type-post_type
> menu-item-24"><a href="...about">About</a></li>
>
> Previously, the menu-item-# was only included in the id. This seems like a
> fairly arbitrary
> change, and I'm not even sure it is a good idea to use the same name as an
> ID and a class.
>

I'm curious how this broke your theme. If you used #menu-item-24 then the
class menu-item-24 (which didn't previously exist) didn't affect you.

It wasn't arbitrary -- here's the explanation. We added the classes because
we were incorrectly using the ID on the second instance of the same menu
(say, in both the header and footer), which resulted in an ID using more
than once. So now the ID only shows up on the first instance of the menu,
and classes are on both.


More information about the wp-testers mailing list