Make WordPress Core


Ignore:
Timestamp:
05/26/2021 01:10:57 AM (3 years ago)
Author:
ryelle
Message:

Block Editor: Add support for the pattern directory.

Add an endpoint for fetching block patterns from WordPress.org, and load the block patterns from this new API. Remove the block patterns that have already been moved to WordPress.org/patterns.

Props ryelle, iandunn, youknowriad, timothyblynjacobs.
Fixes #53246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/block-editor.php

    r50996 r51021  
    3030
    3131        $post = $this->factory()->post->create_and_get( $args );
     32
     33        global $wp_rest_server;
     34        $wp_rest_server = new Spy_REST_Server;
     35        do_action( 'rest_api_init', $wp_rest_server );
     36    }
     37
     38    public function tearDown() {
     39        /** @var WP_REST_Server $wp_rest_server */
     40        global $wp_rest_server;
     41        $wp_rest_server = null;
     42        parent::tearDown();
    3243    }
    3344
Note: See TracChangeset for help on using the changeset viewer.