Skip to content

Commit

Permalink
REST API: Revert widget endpoints
Browse files Browse the repository at this point in the history
Reverts [50993] as it has missing props.

Reverts [50993].
See #41683.

Built from https://develop.svn.wordpress.org/trunk@50994


git-svn-id: http://core.svn.wordpress.org/trunk@50603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
noisysocks committed May 25, 2021
1 parent 2a4e1e0 commit ed195fb
Show file tree
Hide file tree
Showing 24 changed files with 5 additions and 2,151 deletions.
18 changes: 0 additions & 18 deletions wp-includes/class-wp-widget-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,4 @@ public function _register_widgets() {
$this->widgets[ $key ]->_register();
}
}

/**
* Returns the registered WP_Widget object for the given widget type.
*
* @since 5.8.0
*
* @param string $id_base Widget type ID.
* @return WP_Widget|null
*/
public function get_widget_object( $id_base ) {
foreach ( $this->widgets as $widget_object ) {
if ( $widget_object->id_base === $id_base ) {
return $widget_object;
}
}

return null;
}
}
3 changes: 0 additions & 3 deletions wp-includes/default-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,3 @@

/** WP_Widget_Custom_HTML class */
require_once ABSPATH . WPINC . '/widgets/class-wp-widget-custom-html.php';

/** WP_Widget_Block class */
require_once ABSPATH . WPINC . '/widgets/class-wp-widget-block.php';
12 changes: 0 additions & 12 deletions wp-includes/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,6 @@ function create_initial_rest_routes() {
$controller = new WP_REST_Plugins_Controller();
$controller->register_routes();

// Sidebars.
$controller = new WP_REST_Sidebars_Controller();
$controller->register_routes();

// Widget Types.
$controller = new WP_REST_Widget_Types_Controller();
$controller->register_routes();

// Widgets.
$controller = new WP_REST_Widgets_Controller();
$controller->register_routes();

// Block Directory.
$controller = new WP_REST_Block_Directory_Controller();
$controller->register_routes();
Expand Down
Loading

0 comments on commit ed195fb

Please sign in to comment.