WordPress.org

Make WordPress Core

Ticket #16714: 16714.7.diff

File 16714.7.diff, 2.3 KB (added by johnbillion, 5 years ago)
  • wp-admin/menu.php

     
    122122
    123123        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );
    124124        $submenu["edit.php?post_type=$ptype"][5]  = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts,  "edit.php?post_type=$ptype");
    125         $submenu["edit.php?post_type=$ptype"][10]  = array( $ptype_obj->labels->add_new, $ptype_obj->cap->edit_posts, "post-new.php?post_type=$ptype" );
     125        $submenu["edit.php?post_type=$ptype"][10]  = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, "post-new.php?post_type=$ptype" );
    126126
    127127        $i = 15;
    128128        foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
  • wp-includes/admin-bar.php

     
    486486
    487487        $cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' );
    488488
    489         if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->edit_posts ) )
     489        if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) )
    490490                $actions[ 'post-new.php' ] = array( $cpts['post']->labels->name_admin_bar, 'new-post' );
    491491
    492492        if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) )
     
    495495        if ( current_user_can( 'manage_links' ) )
    496496                $actions[ 'link-add.php' ] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' );
    497497
    498         if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->edit_posts ) )
     498        if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) )
    499499                $actions[ 'post-new.php?post_type=page' ] = array( $cpts['page']->labels->name_admin_bar, 'new-page' );
    500500
    501501        unset( $cpts['post'], $cpts['page'], $cpts['attachment'] );
    502502
    503503        // Add any additional custom post types.
    504504        foreach ( $cpts as $cpt ) {
    505                 if ( ! current_user_can( $cpt->cap->edit_posts ) )
     505                if ( ! current_user_can( $cpt->cap->create_posts ) )
    506506                        continue;
    507507
    508508                $key = 'post-new.php?post_type=' . $cpt->name;