PluginProbe
Gutenberg / 21.1.1
Gutenberg v21.1.1
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / load.php

load.php in Gutenberg 21.1.1, at lib/load.php

165 lines 7.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Load API functions, register scripts and actions, etc.
4 *
5 * @package gutenberg
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die( 'Silence is golden.' );
10 }
11
12 define( 'IS_GUTENBERG_PLUGIN', true );
13
14 require_once __DIR__ . '/init.php';
15 require_once __DIR__ . '/upgrade.php';
16
17 /**
18 * Checks whether the Gutenberg experiment is enabled.
19 *
20 * @since 6.7.0
21 *
22 * @param string $name The name of the experiment.
23 *
24 * @return bool True when the experiment is enabled.
25 */
26 function gutenberg_is_experiment_enabled( $name ) {
27 $experiments = get_option( 'gutenberg-experiments' );
28 return ! empty( $experiments[ $name ] );
29 }
30
31 // These files only need to be loaded if within a rest server instance.
32 // which this class will exist if that is the case.
33 if ( class_exists( 'WP_REST_Controller' ) ) {
34 if ( ! class_exists( 'WP_REST_Block_Editor_Settings_Controller' ) ) {
35 require_once __DIR__ . '/experimental/class-wp-rest-block-editor-settings-controller.php';
36 }
37
38 // WordPress 6.8 compat.
39 require __DIR__ . '/compat/wordpress-6.8/rest-api.php';
40
41 // WordPress 6.9 compat.
42 require __DIR__ . '/compat/wordpress-6.9/rest-api.php';
43 require __DIR__ . '/compat/wordpress-6.9/class-gutenberg-hierarchical-sort.php';
44
45 // Plugin specific code.
46 require_once __DIR__ . '/class-wp-rest-global-styles-controller-gutenberg.php';
47 require_once __DIR__ . '/class-wp-rest-edit-site-export-controller-gutenberg.php';
48 require_once __DIR__ . '/rest-api.php';
49
50 require_once __DIR__ . '/experimental/rest-api.php';
51 require_once __DIR__ . '/experimental/kses-allowed-html.php';
52
53 // Block Comments.
54 if ( gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
55 require __DIR__ . '/experimental/block-comments.php';
56 require __DIR__ . '/experimental/class-gutenberg-rest-comment-controller.php';
57 }
58 }
59
60 // Experimental signaling server.
61 if ( ! class_exists( 'Gutenberg_HTTP_Singling_Server' ) ) {
62 require_once __DIR__ . '/experimental/sync/class-gutenberg-http-signaling-server.php';
63 }
64
65 require __DIR__ . '/experimental/editor-settings.php';
66
67 // Gutenberg plugin compat.
68 require __DIR__ . '/compat/plugin/edit-site-routes-backwards-compat.php';
69 require __DIR__ . '/compat/plugin/fonts.php';
70
71 // WordPress 6.8 compat.
72 // Note: admin-bar.php (69271) was reverted in Gutenberg 20.8.0. See https://github.com/WordPress/gutenberg/pull/69974.
73 require __DIR__ . '/compat/wordpress-6.8/preload.php';
74 require __DIR__ . '/compat/wordpress-6.8/blocks.php';
75 require __DIR__ . '/compat/wordpress-6.8/functions.php';
76 require __DIR__ . '/compat/wordpress-6.8/site-editor.php';
77 require __DIR__ . '/compat/wordpress-6.8/class-gutenberg-rest-user-controller.php';
78 require __DIR__ . '/compat/wordpress-6.8/block-template-utils.php';
79 require __DIR__ . '/compat/wordpress-6.8/site-preview.php';
80
81 // Experimental features.
82 require __DIR__ . '/experimental/block-editor-settings-mobile.php';
83 require __DIR__ . '/experimental/blocks.php';
84 require __DIR__ . '/experimental/navigation-theme-opt-in.php';
85 require __DIR__ . '/experimental/kses.php';
86 require __DIR__ . '/experimental/l10n.php';
87 require __DIR__ . '/experimental/synchronization.php';
88 require __DIR__ . '/experimental/script-modules.php';
89 require __DIR__ . '/experimental/posts/load.php';
90
91 if ( gutenberg_is_experiment_enabled( 'gutenberg-no-tinymce' ) ) {
92 require __DIR__ . '/experimental/disable-tinymce.php';
93 }
94
95 // Load the BC Layer to avoid fatal errors of extenders using the Fonts API.
96 // @core-merge: do not merge the BC layer files into WordPress Core.
97 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-provider.php';
98 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-utils.php';
99 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts.php';
100 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-provider-local.php';
101 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-resolver.php';
102 require __DIR__ . '/experimental/font-face/bc-layer/class-gutenberg-fonts-api-bc-layer.php';
103 require __DIR__ . '/experimental/font-face/bc-layer/webfonts-deprecations.php';
104 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-utils.php';
105 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-provider.php';
106 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-provider-local.php';
107 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts.php';
108 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-web-fonts.php';
109
110 // Plugin specific code.
111 require __DIR__ . '/script-loader.php';
112 require __DIR__ . '/global-styles-and-settings.php';
113 require __DIR__ . '/class-wp-theme-json-data-gutenberg.php';
114 require __DIR__ . '/class-wp-theme-json-gutenberg.php';
115 require __DIR__ . '/class-wp-theme-json-resolver-gutenberg.php';
116 require __DIR__ . '/class-wp-theme-json-schema-gutenberg.php';
117 require __DIR__ . '/class-wp-duotone-gutenberg.php';
118 require __DIR__ . '/blocks.php';
119 require __DIR__ . '/block-editor-settings.php';
120 require __DIR__ . '/client-assets.php';
121 require __DIR__ . '/demo.php';
122 require __DIR__ . '/experiments-page.php';
123 require __DIR__ . '/interactivity-api.php';
124 require __DIR__ . '/block-template-utils.php';
125
126 // Copied package PHP files.
127 if ( is_dir( __DIR__ . '/../build/style-engine' ) ) {
128 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-declarations-gutenberg.php';
129 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-rule-gutenberg.php';
130 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-rules-store-gutenberg.php';
131 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-processor-gutenberg.php';
132 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-gutenberg.php';
133 require_once __DIR__ . '/../build/style-engine/style-engine-gutenberg.php';
134 }
135
136 // Block supports overrides.
137 require __DIR__ . '/block-supports/settings.php';
138 require __DIR__ . '/block-supports/elements.php';
139 require __DIR__ . '/block-supports/colors.php';
140 require __DIR__ . '/block-supports/typography.php';
141 require __DIR__ . '/block-supports/border.php';
142 require __DIR__ . '/block-supports/layout.php';
143 require __DIR__ . '/block-supports/position.php';
144 require __DIR__ . '/block-supports/spacing.php';
145 require __DIR__ . '/block-supports/dimensions.php';
146 require __DIR__ . '/block-supports/duotone.php';
147 require __DIR__ . '/block-supports/shadow.php';
148 require __DIR__ . '/block-supports/background.php';
149 require __DIR__ . '/block-supports/block-style-variations.php';
150 require __DIR__ . '/block-supports/aria-label.php';
151
152 // Data views.
153 require_once __DIR__ . '/experimental/data-views.php';
154
155 // Client-side media processing.
156 if ( gutenberg_is_experiment_enabled( 'gutenberg-media-processing' ) ) {
157 require_once __DIR__ . '/experimental/media/load.php';
158 }
159
160 // Interactivity API full-page client-side navigation.
161 if ( gutenberg_is_experiment_enabled( 'gutenberg-full-page-client-side-navigation' ) ) {
162 require __DIR__ . '/experimental/interactivity-api/class-gutenberg-interactivity-api-full-page-navigation.php';
163 Gutenberg_Interactivity_API_Full_Page_Navigation::instance();
164 }
165