Skip to content

Commit

Permalink
First stab at sidebars_widgets-based widget management (#24290)
Browse files Browse the repository at this point in the history
* First stab at sidebars_widgets based widget management

* Render widgets screen based on sidebars endpoint

* Fully functional blocks rendering

* Add a scaffold of store-based saving

* Sidebars API -based widget management

* Entity-based save operation

* Enable REST-based widgets save operation

* Display success/error notice after saving

* Add the experimental sidebars controller

* Clean up unused apis

* Restore the widget-forms endpoint

* Refactor widget-forms to widget-utils controller

* Make widget form and preview work

* Remove $core_widgets = [] override

* Make the new widgets screen fully functional

* Remove obsolete changes

* Remove unused code

* Restore the experimental customizer UI

* Lint PHP code

* Lint

* Add permissions_check

* Define read / edit routes using a single declaration

* replace get_param with array syntax

* Add wp_slash to input widget settings

* Use schema

* lint

* Use single, global editor instead of separate editors

* Update lib/class-wp-rest-sidebars-controller.php

Co-authored-by: Robert Anderson <robert@noisysocks.com>

* Update lib/class-wp-rest-widget-utils-controller.php

Co-authored-by: Robert Anderson <robert@noisysocks.com>

* Update packages/edit-widgets/src/components/widget-areas-block-editor-content/index.js

Co-authored-by: Robert Anderson <robert@noisysocks.com>

* Remove lib/class-experimental-wp-widget-blocks-manager.php

* Clean up the endpoints

* Invoke getWidgetAreas at the top level

* rename widgetArea entity to sidebars

* Enable the experiment code conditionally

* Load Gutenberg styles on widgets.php

* Make the API compatible with old-style widgets

* Clean up WP_REST_Widget_Utils_Controller

* revert code data layer change

* Add unit tests for the endpoints

* Fix indexing bug

Co-authored-by: Robert Anderson <robert@noisysocks.com>
  • Loading branch information
adamziel and noisysocks authored Aug 13, 2020
1 parent 21a8791 commit e3d4e49
Show file tree
Hide file tree
Showing 32 changed files with 1,913 additions and 964 deletions.
11 changes: 11 additions & 0 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,14 @@ function register_site_icon_url( $response ) {
}

add_filter( 'rest_index', 'register_site_icon_url' );

/**
* Registers the WP_Widget_Block widget
*/
function gutenberg_register_widgets() {
if ( gutenberg_is_experiment_enabled( 'gutenberg-widget-experiments' ) ) {
register_widget( 'WP_Widget_Block' );
}
}

add_action( 'widgets_init', 'gutenberg_register_widgets' );
Loading

0 comments on commit e3d4e49

Please sign in to comment.