menu-breadcrumb icon indicating copy to clipboard operation
menu-breadcrumb copied to clipboard

Doesn't find crumbs for news that are not on the front page

Open benjaminpick opened this issue 10 years ago • 3 comments
trafficstars

I am using a static page as front page, and a different one for the news. Currently, the Breadcrumbs of the news overview page & news detail page do not show.

(While debugging, I realized that wp_get_nav_menu_items never returns items with "current", so he is only comparing URLs.)

benjaminpick avatar Mar 11 '15 10:03 benjaminpick

Reading the WP code, I found that the current class is only added in the method _wp_menu_item_classes_by_context() - which is private. So we should get the menu items via the filter wp_nav_menu_objects - this would also have the advantage that they are already in a hierachical order.

I will try to write a pull request.

benjaminpick avatar Mar 11 '15 15:03 benjaminpick

This is great @benjaminpick — as with your other two PRs it'd be awesome for this to get updated to master and rolled in, thank you again for taking the time on these improvements!

jchristopher avatar Apr 20 '15 21:04 jchristopher

Updates now.

benjaminpick avatar May 11 '15 07:05 benjaminpick