lib
block-supports
4 months ago
compat
3 months ago
experimental
3 months ago
media
3 months ago
README.md
10.0 KB
7 months ago
block-editor-settings.php
5.4 KB
7 months ago
block-template-utils.php
3.5 KB
1 year ago
blocks.php
11.8 KB
7 months ago
class-wp-duotone-gutenberg.php
37.6 KB
5 months ago
class-wp-icons-registry-gutenberg.php
7.1 KB
4 months ago
class-wp-rest-edit-site-export-controller-gutenberg.php
1.2 KB
2 years ago
class-wp-rest-global-styles-controller-gutenberg.php
24.5 KB
7 months ago
class-wp-rest-icons-controller-gutenberg.php
481 B
4 months ago
class-wp-theme-json-data-gutenberg.php
1.7 KB
2 years ago
class-wp-theme-json-gutenberg.php
196.1 KB
3 months ago
class-wp-theme-json-resolver-gutenberg.php
34.7 KB
6 months ago
class-wp-theme-json-schema-gutenberg.php
7.4 KB
7 months ago
client-assets.php
16.4 KB
4 months ago
demo.php
1.6 KB
1 year ago
global-styles-and-settings.php
14.2 KB
7 months ago
init.php
945 B
4 months ago
interactivity-api.php
1.2 KB
7 months ago
load.php
10.9 KB
3 months ago
mathml-kses.php
6.3 KB
10 months ago
overlay-patterns.php
12.2 KB
6 months ago
remove-core-enqueue-scripts.php
779 B
5 months ago
rest-api.php
1.6 KB
4 months ago
script-loader.php
5.9 KB
5 months ago
theme-i18n.json
1.8 KB
7 months ago
theme.json
9.2 KB
5 months ago
upgrade.php
2.6 KB
5 months ago
| 1 | <?php |
| 2 | /** |
| 3 | * PHP and WordPress configuration compatibility functions for the Gutenberg |
| 4 | * editor plugin changes related to REST API. |
| 5 | * |
| 6 | * @package gutenberg |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | die( 'Silence is golden.' ); |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * Overrides the REST controller for the `wp_global_styles` post type. |
| 15 | * |
| 16 | * @param array $args Array of arguments for registering a post type. |
| 17 | * See the register_post_type() function for accepted arguments. |
| 18 | * |
| 19 | * @return array Array of arguments for registering a post type. |
| 20 | */ |
| 21 | function gutenberg_override_global_styles_endpoint( array $args ): array { |
| 22 | $args['rest_controller_class'] = 'WP_REST_Global_Styles_Controller_Gutenberg'; |
| 23 | $args['late_route_registration'] = true; |
| 24 | $args['show_in_rest'] = true; |
| 25 | $args['rest_base'] = 'global-styles'; |
| 26 | |
| 27 | return $args; |
| 28 | } |
| 29 | add_filter( 'register_wp_global_styles_post_type_args', 'gutenberg_override_global_styles_endpoint' ); |
| 30 | |
| 31 | /** |
| 32 | * Registers the Edit Site Export REST API routes. |
| 33 | */ |
| 34 | function gutenberg_register_edit_site_export_controller_endpoints() { |
| 35 | $edit_site_export_controller = new WP_REST_Edit_Site_Export_Controller_Gutenberg(); |
| 36 | $edit_site_export_controller->register_routes(); |
| 37 | } |
| 38 | add_action( 'rest_api_init', 'gutenberg_register_edit_site_export_controller_endpoints' ); |
| 39 | |
| 40 | /** |
| 41 | * Registers the Icons Registry REST API routes. |
| 42 | */ |
| 43 | function gutenberg_register_icon_controller_endpoints() { |
| 44 | $icons_controller = new WP_REST_Icons_Controller_Gutenberg(); |
| 45 | $icons_controller->register_routes(); |
| 46 | } |
| 47 | add_action( 'rest_api_init', 'gutenberg_register_icon_controller_endpoints' ); |
| 48 |