[wp-trac] [WordPress Trac] #14518: The class 'current-category-ancestor' shows on the current category menu item - reproducible
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 3 13:56:15 UTC 2010
#14518: The class 'current-category-ancestor' shows on the current category menu
item - reproducible
--------------------------+-------------------------------------------------
Reporter: juggledad | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Description: If you create a new menu and add a category and add a child
category menu item under it then go to the parent category menu item, you
will see a class 'current-category-ancestor' when it should be 'current-
category' or 'current-category-item'
To reproduce
1) use the TwentyTen theme
2) add two categories: CAT-PARENT and CAT-CHILD
3) add two pages: PAGE-PARENT and PAGE-CHILD
4) add a menu, add the two categories and two pages and adjust them so the
children are under the parents
5) select the CAT-PARENT and look at the source
6) select the PAGE-PARENT and look at the source
Note that when the CAT-PARENT is selected it gets a class of 'current-
category-ancestor' when if is the current category. This class implies
that there is a sub-category that is the current category. The same thing
does not happen for the pages.
Here is the HTML that is generated.
Case 1 - menu item CAT-PARENT selected
<div class="menu-header">
<ul id="menu-test" class="menu">
<li id="menu-item-1408" class="menu-item menu-item-type-
taxonomy current-menu-item current-category-ancestor"><a
href="http://192.168.48.99/wp300/?cat=3">CAT-PARENT</a>
<ul class="sub-menu">
<li id="menu-item-1409" class="menu-item
menu-item-type-taxonomy"><a href="http://192.168.48.99/wp300/?cat=8">CAT-
CHILD</a></li>
</ul>
</li>
<li id="menu-item-1413" class="menu-item menu-item-type-
post_type"><a href="http://192.168.48.99/wp300/?page_id=3">PAGE-PARENT</a>
<ul class="sub-menu">
<li id="menu-item-1411" class="menu-item
menu-item-type-post_type"><a href="http://192.168.48.99/wp300/?page_id=7
">PAGE-CHILD</a></li>
</ul>
</li>
</ul>
</div>
--------------
case 2 - page parent selected
<div class="menu-header">
<ul id="menu-test" class="menu">
<li id="menu-item-1408" class="menu-item menu-item-type-
taxonomy"><a href="http://192.168.48.99/wp300/?cat=3">CAT-PARENT</a>
<ul class="sub-menu">
<li id="menu-item-1409" class="menu-item
menu-item-type-taxonomy"><a href="http://192.168.48.99/wp300/?cat=8">CAT-
CHILD</a></li>
</ul>
</li>
<li id="menu-item-1413" class="menu-item menu-item-type-
post_type current-menu-item page_item page-item-3 current_page_item"><a
href="http://192.168.48.99/wp300/?page_id=3">PAGE-PARENT</a>
<ul class="sub-menu">
<li id="menu-item-1411" class="menu-item
menu-item-type-post_type"><a href="http://192.168.48.99/wp300/?page_id=7
">PAGE-CHILD</a></li>
</ul>
</li>
</ul>
</div>
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14518>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list