Make WordPress Core

Changeset 44687


Ignore:
Timestamp:
01/22/2019 12:04:22 AM (6 years ago)
Author:
pento
Message:

Blocks: Define the edit_posts capability on the wp_block post type.

Meta capability mapping doesn't recurse through multiple meta definitions, which creates a situation where the capabilities test is looking for the non-existent primitive capability edit_blocks, which should instead be mapped to edit_posts.

Defining the edit_posts capability when the wp_block post type is registered causes this check to change to to the edit_posts capability.

Props aduth.
Fixes #45373.

File:
1 edited

Legend:

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

    r44668 r44687  
    293293                // You need to be able to publish posts, in order to create blocks.
    294294                'create_posts'           => 'publish_posts',
     295                'edit_posts'             => 'edit_posts',
    295296                'edit_published_posts'   => 'edit_published_posts',
    296297                'delete_published_posts' => 'delete_published_posts',
Note: See TracChangeset for help on using the changeset viewer.