[wp-trac] [WordPress Trac] #45373: New reusable block creation returning blank white screen
WordPress Trac
noreply at wordpress.org
Mon Jan 21 01:18:57 UTC 2019
#45373: New reusable block creation returning blank white screen
------------------------------+-----------------------
Reporter: umakantsharmamwb | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.1
Component: Editor | Version: 5.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses: rest-api
------------------------------+-----------------------
Comment (by peterwilsoncc):
For reference:
The REST controller returns the `403` from `src/wp-includes/rest-
api/endpoints/class-wp-rest-posts-controller.php:L404`
The post type's capabilities are a bit of a mix.
* the three meta caps each end in `_block`
* the primitive caps are a 50/50 mix of `*_blocks` and `*_posts`
{{{
$ wp eval "var_dump( get_post_type_object( 'wp_block' )->cap );"
class stdClass#1635 (15) {
$edit_post => "edit_block"
$read_post => "read_block"
$delete_post => "delete_block"
$edit_posts => "edit_blocks"
$edit_others_posts => "edit_others_posts"
$publish_posts => "publish_blocks"
$read_private_posts => "read_private_blocks"
$read => "edit_posts"
$delete_posts => "delete_blocks"
$delete_private_posts => "delete_private_blocks"
$delete_published_posts => "delete_published_posts"
$delete_others_posts => "delete_others_posts"
$edit_private_posts => "edit_private_blocks"
$edit_published_posts => "edit_published_posts"
$create_posts => "publish_posts"
}
}}}
In `map_meta_cap()` some of the `*_blocks` are mapped to `*_posts` but I
am not convinced they're being replaced there as intended as the
replacement is occurring in the capability being checked rather than the
capabilities (plural) that get passed to `\WP_User::has_cap()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45373#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list