Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#30616 closed defect (bug) (worksforme)

No Edit Post link in Toolbar if post type is placed as a sub menu using show_in_menu

Reported by: Dumian Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Posts, Post Types Keywords:
Focuses: ui, administration Cc:


If we create new post type with register_post_type function using 'edit.php' as a value of show_in_menu argument (in order to place our post type as a sub menu of Posts in WP Admin area), then if we create new post and display it in the frontend there will be no Edit link in Toolbar (Admin Bar).

Steps to reproduce this bug are very simple (tested in WordPress 4.0.1):

  1. Copy the code below and paste it into functions.php file
function codex_custom_init() {
	$args = array(
		'public' 		 => true,
		'label'  		 => 'Books',
		'show_in_menu' => 'edit.php'
	register_post_type( 'book', $args );
add_action( 'init', 'codex_custom_init' );
  1. Create new post in our newly created Post Type.
  2. Click 'View Post' button.

(To see the post maybe you have to flush rewrite rules)

Change History (4)

#1 @joedolson
7 years ago

  • Focuses accessibility removed

#2 @helen
7 years ago

  • Version changed from trunk to 4.0

#3 @DrewAPicture
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Hi @Dumian,

Using your code sample and flushing permalinks on 4.3, I'm sseing the 'Edit Post' link in the Toolbar as expected. Closing as worksforme. Feel free to reopen if you continue to experience this issue.

#4 @Dumian
6 years ago

It works fine with the newest version of WordPress (4.3).

Note: See TracTickets for help on using tickets.