Make WordPress Core

Ticket #45098: 45098.4.diff

File 45098.4.diff, 1.7 KB (added by danielbachhuber, 7 years ago)
  • src/wp-includes/post.php

    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() { 
    229229                'wp_block',
    230230                array(
    231231                        'labels'                => array(
    232                                 'name'          => __( 'Blocks'),
     232                                'name'          => __( 'Blocks' ),
    233233                                'singular_name' => __( 'Block' ),
    234234                                'search_items'  => __( 'Search Blocks' ),
    235235                        ),
    function create_initial_post_types() { 
    242242                        'rest_base'             => 'blocks',
    243243                        'rest_controller_class' => 'WP_REST_Blocks_Controller',
    244244                        'capability_type'       => 'block',
    245                         'capabilities' => array(
     245                        'capabilities'          => array(
    246246                                // You need to be able to edit posts, in order to read blocks in their raw form.
    247247                                'read'                   => 'edit_posts',
    248248                                // You need to be able to publish posts, in order to create blocks.
  • src/wp-includes/rest-api/endpoints/class-wp-rest-block-renderer-controller.php

    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 { 
    9393                        if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) {
    9494                                return new WP_Error(
    9595                                        '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.' ),
    9797                                        array(
    9898                                                'status' => rest_authorization_required_code(),
    9999                                        )