Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28287 closed defect (bug) (duplicate)

CPT with 'show_in_menu' => 'users.php' does not get highlighted when adding new

Reported by: dontdream's profile dontdream Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: Posts, Post Types Keywords: has-patch
Focuses: administration Cc:

Description (last modified by SergeyBiryukov)

When registering a post type as a submenu of a top level menu, the submenu item does not get highlighted correctly when adding a new item to the post type.

Code to reproduce:

add_action ('init', 'cptest');
function cptest ()
{
	$args = array
	(
		'labels' => array
		(
			'name' => 'FooBars',
			'singular_name' => 'FooBar',
		),
		'public' => false,
		'show_ui' => true,
		'show_in_menu' => 'users.php',
	);

	register_post_type ('foobar', $args);
}

  1. Click Users -> FooBars
  2. In the newly opened admin page, click Add New (add new FooBar)
  3. The All Users submenu item gets highlighted, instead of FooBars

This is very similar to ticket #24137, and is fixed by patch 24137.2.patch by markjaquith, attached to that ticket and replicated as attachment to this ticket.

Attachments (1)

24137.2.patch (1.2 KB) - added by dontdream 11 years ago.
fixes ticket 28287

Download all attachments as: .zip

Change History (3)

@dontdream
11 years ago

fixes ticket 28287

#1 @dontdream
11 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
11 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #24137.

Note: See TracTickets for help on using tickets.