Skip to content

Commit

Permalink
Remove WP 6.0 WP_REST_Block_Patterns_Controller class (#41914)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Jun 23, 2022
1 parent bed559b commit 56f0c12
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 234 deletions.
219 changes: 0 additions & 219 deletions lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php

This file was deleted.

9 changes: 0 additions & 9 deletions lib/compat/wordpress-6.0/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ function gutenberg_register_edit_site_export_endpoint() {
}
add_action( 'rest_api_init', 'gutenberg_register_edit_site_export_endpoint' );

/**
* Registers the block patterns REST API routes.
*/
function gutenberg_register_rest_block_patterns() {
$block_patterns = new WP_REST_Block_Patterns_Controller();
$block_patterns->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_rest_block_patterns' );

/**
* Registers the block pattern categories REST API routes.
*/
Expand Down
3 changes: 0 additions & 3 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ function gutenberg_is_experiment_enabled( $name ) {
require_once __DIR__ . '/compat/wordpress-6.0/class-gutenberg-rest-global-styles-controller.php';
require_once __DIR__ . '/compat/wordpress-6.0/class-gutenberg-rest-pattern-directory-controller.php';
require_once __DIR__ . '/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php';
if ( ! class_exists( 'WP_REST_Block_Patterns_Controller' ) ) {
require_once __DIR__ . '/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php';
}
if ( ! class_exists( 'WP_REST_Block_Pattern_Categories_Controller' ) ) {
require_once __DIR__ . '/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php';
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Unit tests covering WP_REST_Block_Patterns_Controller functionality.
* Unit tests covering Gutenberg_REST_Block_Patterns_Controller functionality.
*
* @package WordPress
* @subpackage REST_API
Expand All @@ -10,9 +10,9 @@
* Unit tests for REST API for Block Patterns.
*
* @group restapi
* @covers WP_REST_Block_Patterns_Controller
* @covers Gutenberg_REST_Block_Patterns_Controller
*/
class WP_REST_Block_Patterns_Controller_Test extends WP_Test_REST_Controller_Testcase {
class Gutenberg_REST_Block_Patterns_Controller_Test extends WP_Test_REST_Controller_Testcase {
protected static $admin_id;
protected static $orig_registry;

Expand Down

0 comments on commit 56f0c12

Please sign in to comment.