[wp-trac] [WordPress Trac] #63261: Menu items incorrectly marked as current when page and taxonomy share the same object_id

WordPress Trac noreply at wordpress.org
Wed May 21 10:40:38 UTC 2025


#63261: Menu items incorrectly marked as current when page and taxonomy share the
same object_id
-----------------------------------+----------------------------
 Reporter:  nuadagency             |       Owner:  audrasjb
     Type:  defect (bug)           |      Status:  assigned
 Priority:  normal                 |   Milestone:  6.9
Component:  Menus                  |     Version:  6.7.2
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  accessibility
-----------------------------------+----------------------------
Changes (by nuadagency):

 * keywords:  reporter-feedback has-patch => has-patch 2nd-opinion


Comment:

 Thanks for reviewing this. I checked your screencast and test steps, and I
 think **there’s a fundamental mismatch in what you attempted versus the
 issue I reported**.

 The original report is explicitly about conflicting object types — for
 example, a WP_Post (like a Page) and a WP_Term (like a product_cat
 taxonomy term) — sharing the same ID and being incorrectly marked as
 current in menus due to a loose object_id match.

 Your test uses a Post and a Category — which are designed to work together
 in core — and both fall under WordPress's built-in post-category system.
 That setup doesn’t replicate the issue because it doesn’t create a type
 mismatch between objects.

 So to reproduce this accurately, it’s necessary to involve a custom
 taxonomy like WooCommerce's product_cat. The issue typically occurs on
 term archive pages (e.g., /product-category/boots/) where a taxonomy term
 and a page share the same numeric ID, and both are added to the nav menu.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63261#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list