WordPress.org

Make WordPress Core

Ticket #30991: 30991.3.diff

File 30991.3.diff, 3.1 KB (added by johnbillion, 3 years ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index 454e19a57f..16cb7dcec2 100644
    function unregister_post_type( $post_type ) { 
    13761376 * Otherwise, an 's' will be added to the value for the plural form. After
    13771377 * registration, capability_type will always be a string of the singular value.
    13781378 *
    1379  * By default, seven keys are accepted as part of the capabilities array:
     1379 * By default, eight keys are accepted as part of the capabilities array:
    13801380 *
    13811381 * - edit_post, read_post, and delete_post are meta capabilities, which are then
    13821382 *   generally mapped to corresponding primitive capabilities depending on the
    13831383 *   context, which would be the post being edited/read/deleted and the user or
    13841384 *   role being checked. Thus these capabilities would generally not be granted
    13851385 *   directly to users or roles.
    1386  *
    13871386 * - edit_posts - Controls whether objects of this post type can be edited.
    13881387 * - edit_others_posts - Controls whether objects of this type owned by other users
    13891388 *   can be edited. If the post type does not support an author, then this will
    13901389 *   behave like edit_posts.
     1390 * - delete_posts - Controls whether objects of this post type can be deleted.
    13911391 * - publish_posts - Controls publishing objects of this post type.
    13921392 * - read_private_posts - Controls whether private objects can be read.
    13931393 *
    13941394 * These four primitive capabilities are checked in core in various locations.
    1395  * There are also seven other primitive capabilities which are not referenced
     1395 * There are also six other primitive capabilities which are not referenced
    13961396 * directly in core, except in map_meta_cap(), which takes the three aforementioned
    13971397 * meta capabilities and translates them into one or more primitive capabilities
    13981398 * that must then be checked against the user or role, depending on the context.
    13991399 *
    14001400 * - read - Controls whether objects of this post type can be read.
    1401  * - delete_posts - Controls whether objects of this post type can be deleted.
    14021401 * - delete_private_posts - Controls whether private objects can be deleted.
    14031402 * - delete_published_posts - Controls whether published objects can be deleted.
    14041403 * - delete_others_posts - Controls whether objects owned by other users can be
    function get_post_type_capabilities( $args ) { 
    14351434                // Primitive capabilities used outside of map_meta_cap():
    14361435                'edit_posts'         => 'edit_' . $plural_base,
    14371436                'edit_others_posts'  => 'edit_others_' . $plural_base,
     1437                'delete_posts'       => 'delete_' . $plural_base,
    14381438                'publish_posts'      => 'publish_' . $plural_base,
    14391439                'read_private_posts' => 'read_private_' . $plural_base,
    14401440        );
    function get_post_type_capabilities( $args ) { 
    14431443        if ( $args->map_meta_cap ) {
    14441444                $default_capabilities_for_mapping = array(
    14451445                        'read'                   => 'read',
    1446                         'delete_posts'           => 'delete_' . $plural_base,
    14471446                        'delete_private_posts'   => 'delete_private_' . $plural_base,
    14481447                        'delete_published_posts' => 'delete_published_' . $plural_base,
    14491448                        'delete_others_posts'    => 'delete_others_' . $plural_base,