WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#14591 closed defect (bug) (fixed)

Admin menu.php incorrectly sets page taxonomy query string

Reported by: t31os_ Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version:
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

Hi,

I've been working with the admin menu code over the last week (personal project, writing a menu), and i've come to spot a bug with taxonomy submenu items under the "Page" post type.

In wp-admin/menu.php, 3.0.1 and current trunk, each taxonomy under the page post type sets the menu item URL with post_type first, followed by taxonomy.

Unfortunately this is contrary to how $submenu_file is set, which places the taxonomy onto the URL first, followed by the post type (which is how every other post type is treated, tax first, post type second).

For any post type not a page, the typical URL is..

edit-tags.php?taxonomy=TAXNAME&post_type=POST_TYPE

For pages, this becomes.

edit-tags.php?post_type=POST_TYPE&taxonomy=TAXNAME

This causes the conditional checks performed in wp-admin/menu-header.php to fail for page taxonomies (discovered when performing my own similar checks), and submenu items are not correctly marked as active.

Patch for trunk is attached.

Attachments (1)

menu-fix.patch (651 bytes) - added by t31os_ 9 years ago.
Fix page query arg order for page taxonomies in menu.php, fixes non-active page taxonomy submenu items.

Download all attachments as: .zip

Change History (6)

@t31os_
9 years ago

Fix page query arg order for page taxonomies in menu.php, fixes non-active page taxonomy submenu items.

#1 @scribu
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.1
  • Severity changed from normal to minor

Looks good.

#2 @t31os_
9 years ago

Thanks. :)

For clarity, to replicate said bug, register a taxonomy for the page post type and click the taxonomy link, the correct page is shown(edit-tags.php), but the menu item is not highlighted (due to the reasons stated in opening).

#3 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15556]) Fix page taxonomy query string. Props t31os_. fixes #14591

#4 @nacin
8 years ago

  • Milestone changed from 3.1 to 3.0.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

Related #14489. [15423] was pretty much botched.

#5 @nacin
8 years ago

  • Milestone changed from 3.0.2 to 3.1
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.