Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#14591 closed defect (bug) (fixed)

Admin menu.php incorrectly sets page taxonomy query string

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

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_ 16 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_
16 years ago

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

#1 @scribu
16 years ago

  • Keywords commit added
  • Milestone Awaiting Review → 3.1
  • Severity normal → minor

Looks good.

#2 @t31os_
16 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
16 years ago

  • Resolution → fixed
  • Status new → closed

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

#4 @nacin
16 years ago

  • Milestone 3.1 → 3.0.2
  • Resolution fixed
  • Status closed → reopened

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

#5 @nacin
16 years ago

  • Milestone 3.0.2 → 3.1
  • Resolution → fixed
  • Status reopened → closed
Note: See TracTickets for help on using tickets.