Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 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:
Priority: normal Milestone:
Component: Posts, Post Types Version: 4.0
Severity: normal Keywords:
Cc: Focuses: ui, administration

Description

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
12 years ago

  • Focuses accessibility removed

#2 @helen
12 years ago

  • Version trunk4.0

#3 @DrewAPicture
11 years ago

  • Milestone Awaiting Review
  • Resolutionworksforme
  • Status newclosed

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
11 years ago

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

Note: See TracTickets for help on using tickets.