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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44687 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2019-01-22 00:04:22 +00:00
parent 804cb23503
commit 9bd6c81d1f
1 changed files with 1 additions and 0 deletions

View File

@ -292,6 +292,7 @@ function create_initial_post_types() {
'read' => 'edit_posts',
// You need to be able to publish posts, in order to create blocks.
'create_posts' => 'publish_posts',
'edit_posts' => 'edit_posts',
'edit_published_posts' => 'edit_published_posts',
'delete_published_posts' => 'delete_published_posts',
'edit_others_posts' => 'edit_others_posts',