WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/23/2018 06:52:03 AM (14 months ago)
Author:
pento
Message:

Blocks: Add the reusable block post type, wp_block.

See #45098.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/capabilities.php

    r43510 r43804  
    556556        }
    557557
     558        // Block capabilities map to their post equivalent.
     559        $block_caps = array(
     560            'edit_blocks',
     561            'edit_others_blocks',
     562            'publish_blocks',
     563            'read_private_blocks',
     564            'delete_blocks',
     565            'delete_private_blocks',
     566            'delete_published_blocks',
     567            'delete_others_blocks',
     568            'edit_private_blocks',
     569            'edit_published_blocks',
     570        );
     571        if ( in_array( $cap, $block_caps, true ) ) {
     572            $cap = str_replace( '_blocks', '_posts', $cap );
     573        }
     574
    558575        // If no meta caps match, return the original cap.
    559576        $caps[] = $cap;
Note: See TracChangeset for help on using the changeset viewer.