Make WordPress Core


Ignore:
Timestamp:
07/28/2020 04:08:56 AM (5 years ago)
Author:
TimothyBlynJacobs
Message:

REST API: Remove assets field from block directory controller.

Gutenberg no longer uses the assets field to fetch the assets for the installed block so this field can be dropped from the endpoint. This allows us to reintroduce it at a later point without needing to worry about backward compatibility.

See #50732.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-block-directory-controller.php

    r48333 r48656  
    163163            'author'              => 'sorta brilliant',
    164164            'icon'                => 'https://ps.w.org/guidepost/assets/icon-128x128.jpg?rev=2235512',
    165             'assets'              => array(
    166                 'https://ps.w.org/guidepost/tags/1.2.1/build/index.js?v=1584940380',
    167                 'https://ps.w.org/guidepost/tags/1.2.1/build/guidepost-editor.css?v=1584940380',
    168                 'https://ps.w.org/guidepost/tags/1.2.1/build/guidepost-style.css?v=1584940380',
    169                 'https://ps.w.org/guidepost/tags/1.2.1/build/guidepost-theme.js?v=1584940380',
    170             ),
    171165            'last_updated'        => gmdate( 'Y-m-d\TH:i:s', strtotime( $plugin['last_updated'] ) ),
    172166            'humanized_updated'   => sprintf( '%s ago', human_time_diff( strtotime( $plugin['last_updated'] ) ) ),
     
    193187        $properties = $data['schema']['properties'];
    194188
    195         $this->assertCount( 14, $properties );
     189        $this->assertCount( 13, $properties );
    196190        $this->assertArrayHasKey( 'name', $properties );
    197191        $this->assertArrayHasKey( 'title', $properties );
     
    207201        $this->assertArrayHasKey( 'last_updated', $properties );
    208202        $this->assertArrayHasKey( 'humanized_updated', $properties );
    209         $this->assertArrayHasKey( 'assets', $properties );
    210203    }
    211204
Note: See TracChangeset for help on using the changeset viewer.