Use the create_posts post type cap in more places. Remove the janky create_posts meta cap. see #16714.

git-svn-id: https://develop.svn.wordpress.org/trunk@22908 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-11-28 22:28:20 +00:00
parent 4e51b43ad3
commit 5aac5cb3de
6 changed files with 12 additions and 15 deletions

View File

@@ -363,13 +363,16 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
'href' => admin_url(),
) );
if ( current_user_can( 'edit_posts' ) ) {
if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
$wp_admin_bar->add_menu( array(
'parent' => $menu_id,
'id' => $menu_id . '-n',
'title' => __( 'New Post' ),
'href' => admin_url( 'post-new.php' ),
) );
}
if ( current_user_can( 'edit_posts' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => $menu_id,
'id' => $menu_id . '-c',