Make WordPress Core


Ignore:
Timestamp:
04/12/2022 09:24:51 AM (5 years ago)
Author:
gziolo
Message:

REST API: Bring new endpoints for Block Patterns from Gutenberg plugin

Related Gutenberg issue: ​https://github.com/WordPress/gutenberg/issues/39889.

Backporting changes from the Gutenberg plugin:

  • new Block Patterns REST API endpoint
  • new Block Pattern Categories REST API endpoint
  • updates to Query Loop related patterns
  • support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r52328 r53152  
    336336        // Pattern Directory.
    337337        $controller = new WP_REST_Pattern_Directory_Controller();
     338        $controller->register_routes();
     339
     340        // Block Patterns.
     341        $controller = new WP_REST_Block_Patterns_Controller();
     342        $controller->register_routes();
     343
     344        // Block Pattern Categories.
     345        $controller = new WP_REST_Block_Pattern_Categories_Controller();
    338346        $controller->register_routes();
    339347
Note: See TracChangeset for help on using the changeset viewer.