Make WordPress Core


Ignore:
Timestamp:
10/24/2012 10:15:43 PM (13 years ago)
Author:
ryan
Message:

Use the create_posts capability in more places.

In get_post_type_capabilities(), make sure create_posts reflects customizations to the edit_posts capability when create_posts is not specifically set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r22264 r22291  
    14121412        'publish_posts'      => 'publish_'      . $plural_base,
    14131413        'read_private_posts' => 'read_private_' . $plural_base,
    1414         // Post creation capability simply maps to edit_posts by default:
    1415         'create_posts'       => 'edit_'         . $plural_base,
    14161414    );
    14171415
     
    14311429
    14321430    $capabilities = array_merge( $default_capabilities, $args->capabilities );
     1431
     1432    // Post creation capability simply maps to edit_posts by default:
     1433    if ( ! isset( $capabilities['create_posts'] ) )
     1434        $capabilities['create_posts'] = $capabilities['edit_posts'];
    14331435
    14341436    // Remember meta capabilities for future reference.
Note: See TracChangeset for help on using the changeset viewer.