-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIP) Add a new endpoint that exposes block editor settings through the REST API #25226
Conversation
Size Change: +1.59 kB (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Ideally this would have a schema documenting the response format. Is the block editor settings array structured enough to support that? |
@TimothyBJacobs Good question! I don't have a precise answer for it right now. Afaik "editor settings" on the client is currently defined by its default value. |
This endpoint should be preloaded on the page. |
# Conflicts: # lib/global-styles.php # lib/load.php # lib/rest-api.php
* @since 5.5.0 | ||
* | ||
* @param WP_REST_Request $request Full details about the request. | ||
* | ||
* @return WP_Error|bool True if the request has permission, WP_Error object otherwise. | ||
*/ | ||
public function get_items_permissions_check( $request ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geriux I think You might still need this when I pull in this commit I get:
Warning: Declaration of WP_REST_Block_Editor_Settings_Controller::get_items() should be compatible with WP_REST_Controller::get_items($request) in /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php on line 59 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/functions.php on line 6362 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-admin/includes/misc.php on line 1310 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-admin/admin-header.php on line 9 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/option.php on line 1051 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/option.php on line 1052
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. | ||
*/ | ||
public function get_items( $request ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geriux I think You might still need this when I pull in this commit I get:
Warning: Declaration of WP_REST_Block_Editor_Settings_Controller::get_items() should be compatible with WP_REST_Controller::get_items($request) in /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php on line 59 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/functions.php on line 6362 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-admin/includes/misc.php on line 1310 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-admin/admin-header.php on line 9 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/option.php on line 1051 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/plugins/gutenberg/lib/class-wp-rest-block-editor-settings-controller.php:0) in /var/www/html/wp-includes/option.php on line 1052
Closing in favor of #29969 |
Description
This new endpoint at
/__experimental/block-editor-settings
will return all the current settings for the block editor. This will be especially useful for the mobile block editor to set up the GSS (Global Style System) and may even be used to load block patterns.This is a WIP and will need to be discussed first.
How has this been tested?
Untested code right now!
Types of changes
New core REST API endpoint
Checklist: