diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 302d2210d5..d040f442e2 100644
|
a
|
b
|
function create_initial_post_types() { |
| 229 | 229 | 'wp_block', |
| 230 | 230 | array( |
| 231 | 231 | 'labels' => array( |
| 232 | | 'name' => __( 'Blocks'), |
| | 232 | 'name' => __( 'Blocks' ), |
| 233 | 233 | 'singular_name' => __( 'Block' ), |
| 234 | 234 | 'search_items' => __( 'Search Blocks' ), |
| 235 | 235 | ), |
| … |
… |
function create_initial_post_types() { |
| 242 | 242 | 'rest_base' => 'blocks', |
| 243 | 243 | 'rest_controller_class' => 'WP_REST_Blocks_Controller', |
| 244 | 244 | 'capability_type' => 'block', |
| 245 | | 'capabilities' => array( |
| | 245 | 'capabilities' => array( |
| 246 | 246 | // You need to be able to edit posts, in order to read blocks in their raw form. |
| 247 | 247 | 'read' => 'edit_posts', |
| 248 | 248 | // You need to be able to publish posts, in order to create blocks. |
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php
index a4f17283c5..f0e1e7db47 100644
|
a
|
b
|
class WP_REST_Block_Renderer_Controller extends WP_REST_Controller { |
| 93 | 93 | if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { |
| 94 | 94 | return new WP_Error( |
| 95 | 95 | 'block_cannot_read', |
| 96 | | __( 'Sorry, you are not allowed to read blocks of this post' ), |
| | 96 | __( 'Sorry, you are not allowed to read blocks of this post.' ), |
| 97 | 97 | array( |
| 98 | 98 | 'status' => rest_authorization_required_code(), |
| 99 | 99 | ) |