Ready to get started?Download WordPress


wp_get_nav_menu_items problem (1 post)

  1. cannon303
    Posted 1 year ago #

    Hi does anyone know a way around this problem. If you have 2 menu items pointing to the same page, they are both marked as being the current menu item in the wp_get_nav_menu_items() classes:

    [classes] => Array (
    			[0] =>
    			[1] => menu-item
    			[2] => menu-item-type-post_type
    			[3] => menu-item-object-page
    			[4] => current-menu-item
    			[5] => page_item
    			[6] => page-item-79
    			[7] => current_page_item

    Even though they both are identical they both can't be current-menu-item as they both have different menu ids.

    Could this be something that needs looking at for a future update?

Topic Closed

This topic has been closed to new replies.

About this Topic