WordPress.org

Make WordPress Core

Ticket #30991: 30991.diff

File 30991.diff, 980 bytes (added by dipesh.kakadiya, 6 years ago)

Add "delete_posts" as default_capabilities in get_post_type_capabilities function

  • src/wp-includes/post.php

     
    15521552                // Primitive capabilities used outside of map_meta_cap():
    15531553                'edit_posts'         => 'edit_'         . $plural_base,
    15541554                'edit_others_posts'  => 'edit_others_'  . $plural_base,
     1555                'delete_posts'       => 'delete_'   . $plural_base,
    15551556                'publish_posts'      => 'publish_'      . $plural_base,
    15561557                'read_private_posts' => 'read_private_' . $plural_base,
    15571558        );
     
    15601561        if ( $args->map_meta_cap ) {
    15611562                $default_capabilities_for_mapping = array(
    15621563                        'read'                   => 'read',
    1563                         'delete_posts'           => 'delete_'           . $plural_base,
    15641564                        'delete_private_posts'   => 'delete_private_'   . $plural_base,
    15651565                        'delete_published_posts' => 'delete_published_' . $plural_base,
    15661566                        'delete_others_posts'    => 'delete_others_'    . $plural_base,