Skip to content

Commit

Permalink
Go with uses_context in REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Jun 17, 2020
1 parent 06aa85e commit e760fd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/class-wp-rest-block-types-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function prepare_item_for_response( $block_type, $request ) {
'editor_style' => 'editor_style',
'style' => 'style',
'provides_context' => 'providesContext',
'use_context' => 'context',
'uses_context' => 'context',
);
foreach ( $extra_fields as $key => $extra_field ) {
if ( rest_is_field_included( $key, $fields ) ) {
Expand Down Expand Up @@ -488,7 +488,7 @@ public function get_item_schema() {
'context' => array( 'embed', 'view', 'edit' ),
'readonly' => true,
),
'use_context' => array(
'uses_context' => array(
'description' => __( 'Context values inherited by blocks of this type.', 'gutenberg' ),
'type' => 'array',
'default' => array(),
Expand Down
4 changes: 2 additions & 2 deletions phpunit/class-wp-rest-block-types-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function test_get_item_schema() {
$this->assertArrayHasKey( 'style', $properties );
$this->assertArrayHasKey( 'parent', $properties );
$this->assertArrayHasKey( 'example', $properties );
$this->assertArrayHasKey( 'use_context', $properties );
$this->assertArrayHasKey( 'uses_context', $properties );
$this->assertArrayHasKey( 'provides_context', $properties );
}

Expand Down Expand Up @@ -351,7 +351,7 @@ public function check_block_type_object( $block_type, $data, $links ) {
'textdomain' => 'textdomain',
'example' => 'example',
'provides_context' => 'providesContext',
'use_context' => 'context',
'uses_context' => 'context',
);

foreach ( $extra_fields as $key => $extra_field ) {
Expand Down

0 comments on commit e760fd1

Please sign in to comment.