Make WordPress Core

Ticket #30991: 30991.4.patch

File 30991.4.patch, 3.0 KB (added by Mte90, 6 years ago)

patch refreshed

  • src/wp-includes/post.php

    commit 16679e3906b47387e2a894d447afea899a225bea
    Author: Daniele Scasciafratte <mte90net@gmail.com>
    Date:   Thu Aug 22 17:50:54 2019 +0200
    
        30991.4
    
    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index 98ad57fbd0..fbc7139d2b 100644
    function unregister_post_type( $post_type ) { 
    13551355 * Otherwise, an 's' will be added to the value for the plural form. After
    13561356 * registration, capability_type will always be a string of the singular value.
    13571357 *
    1358  * By default, seven keys are accepted as part of the capabilities array:
     1358 * By default, eight keys are accepted as part of the capabilities array:
    13591359 *
    13601360 * - edit_post, read_post, and delete_post are meta capabilities, which are then
    13611361 *   generally mapped to corresponding primitive capabilities depending on the
    function unregister_post_type( $post_type ) { 
    13671367 * - edit_others_posts - Controls whether objects of this type owned by other users
    13681368 *   can be edited. If the post type does not support an author, then this will
    13691369 *   behave like edit_posts.
     1370 * - delete_posts - Controls whether objects of this post type can be deleted.
    13701371 * - publish_posts - Controls publishing objects of this post type.
    13711372 * - read_private_posts - Controls whether private objects can be read.
    13721373 *
    13731374 * These four primitive capabilities are checked in core in various locations.
    1374  * There are also seven other primitive capabilities which are not referenced
     1375 * There are also six other primitive capabilities which are not referenced
    13751376 * directly in core, except in map_meta_cap(), which takes the three aforementioned
    13761377 * meta capabilities and translates them into one or more primitive capabilities
    13771378 * that must then be checked against the user or role, depending on the context.
    13781379 *
    13791380 * - read - Controls whether objects of this post type can be read.
    1380  * - delete_posts - Controls whether objects of this post type can be deleted.
    13811381 * - delete_private_posts - Controls whether private objects can be deleted.
    13821382 * - delete_published_posts - Controls whether published objects can be deleted.
    13831383 * - delete_others_posts - Controls whether objects owned by other users can be
    function get_post_type_capabilities( $args ) { 
    14111411                'edit_post'          => 'edit_' . $singular_base,
    14121412                'read_post'          => 'read_' . $singular_base,
    14131413                'delete_post'        => 'delete_' . $singular_base,
     1414                'delete_posts'       => 'delete_' . $plural_base,
    14141415                // Primitive capabilities used outside of map_meta_cap():
    14151416                'edit_posts'         => 'edit_' . $plural_base,
    14161417                'edit_others_posts'  => 'edit_others_' . $plural_base,
    function get_post_type_capabilities( $args ) { 
    14221423        if ( $args->map_meta_cap ) {
    14231424                $default_capabilities_for_mapping = array(
    14241425                        'read'                   => 'read',
    1425                         'delete_posts'           => 'delete_' . $plural_base,
    14261426                        'delete_private_posts'   => 'delete_private_' . $plural_base,
    14271427                        'delete_published_posts' => 'delete_published_' . $plural_base,
    14281428                        'delete_others_posts'    => 'delete_others_' . $plural_base,