PluginProbe
Gutenberg / 20.6.0
Gutenberg v20.6.0
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 20.6.0, at lib/load.php

193 lines 8.8 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.7 compat.
39 require __DIR__ . '/compat/wordpress-6.7/class-gutenberg-rest-posts-controller-6-7.php';
40 require __DIR__ . '/compat/wordpress-6.7/class-gutenberg-rest-templates-controller-6-7.php';
41 require __DIR__ . '/compat/wordpress-6.7/class-gutenberg-rest-server.php';
42 require __DIR__ . '/compat/wordpress-6.7/rest-api.php';
43
44 // WordPress 6.8 compat.
45 require __DIR__ . '/compat/wordpress-6.8/rest-api.php';
46
47 // WordPress 6.9 compat.
48 require __DIR__ . '/compat/wordpress-6.9/class-gutenberg-hierarchical-sort.php';
49
50 // Plugin specific code.
51 require_once __DIR__ . '/class-wp-rest-global-styles-controller-gutenberg.php';
52 require_once __DIR__ . '/class-wp-rest-edit-site-export-controller-gutenberg.php';
53 require_once __DIR__ . '/rest-api.php';
54
55 require_once __DIR__ . '/experimental/rest-api.php';
56 require_once __DIR__ . '/experimental/kses-allowed-html.php';
57
58 // Block Comments.
59 if ( gutenberg_is_experiment_enabled( 'gutenberg-block-comment' ) ) {
60 require __DIR__ . '/experimental/block-comments.php';
61 require __DIR__ . '/experimental/class-gutenberg-rest-comment-controller.php';
62 }
63 }
64
65 // Experimental signaling server.
66 if ( ! class_exists( 'Gutenberg_HTTP_Singling_Server' ) ) {
67 require_once __DIR__ . '/experimental/sync/class-gutenberg-http-signaling-server.php';
68 }
69
70 require __DIR__ . '/experimental/editor-settings.php';
71
72 // Gutenberg plugin compat.
73 require __DIR__ . '/compat/plugin/edit-site-routes-backwards-compat.php';
74 require __DIR__ . '/compat/plugin/fonts.php';
75
76 // The Token Map was created to support the HTML API. It must be loaded before it.
77 require __DIR__ . '/compat/wordpress-6.7/class-gutenberg-token-map-6-7.php';
78
79 // Type annotations were added in 6.7 so every file is updated.
80 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-active-formatting-elements-6-7.php';
81 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-attribute-token-6-7.php';
82 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-decoder-6-7.php';
83 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-open-elements-6-7.php';
84 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-span-6-7.php';
85 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-stack-event-6-7.php';
86 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-text-replacement-6-7.php';
87 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-token-6-7.php';
88 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-unsupported-exception-6-7.php';
89 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-tag-processor-6-7.php';
90 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-processor-state-6-7.php';
91 require __DIR__ . '/compat/wordpress-6.7/html-api/class-gutenberg-html-processor-6-7.php';
92
93 // WordPress 6.7 compat.
94 require __DIR__ . '/compat/wordpress-6.7/block-templates.php';
95 require __DIR__ . '/compat/wordpress-6.7/blocks.php';
96 require __DIR__ . '/compat/wordpress-6.7/block-bindings.php';
97 require __DIR__ . '/compat/wordpress-6.7/script-modules.php';
98 require __DIR__ . '/compat/wordpress-6.7/class-wp-block-templates-registry.php';
99 require __DIR__ . '/compat/wordpress-6.7/compat.php';
100 require __DIR__ . '/compat/wordpress-6.7/post-formats.php';
101
102 // WordPress 6.8 compat.
103 require __DIR__ . '/compat/wordpress-6.8/admin-bar.php';
104 require __DIR__ . '/compat/wordpress-6.8/preload.php';
105 require __DIR__ . '/compat/wordpress-6.8/blocks.php';
106 require __DIR__ . '/compat/wordpress-6.8/functions.php';
107 require __DIR__ . '/compat/wordpress-6.8/site-editor.php';
108 require __DIR__ . '/compat/wordpress-6.8/class-gutenberg-rest-user-controller.php';
109 require __DIR__ . '/compat/wordpress-6.8/block-template-utils.php';
110 require __DIR__ . '/compat/wordpress-6.8/site-preview.php';
111
112 // Experimental features.
113 require __DIR__ . '/experimental/block-editor-settings-mobile.php';
114 require __DIR__ . '/experimental/blocks.php';
115 require __DIR__ . '/experimental/navigation-theme-opt-in.php';
116 require __DIR__ . '/experimental/kses.php';
117 require __DIR__ . '/experimental/l10n.php';
118 require __DIR__ . '/experimental/synchronization.php';
119 require __DIR__ . '/experimental/script-modules.php';
120 require __DIR__ . '/experimental/posts/load.php';
121
122 if ( gutenberg_is_experiment_enabled( 'gutenberg-no-tinymce' ) ) {
123 require __DIR__ . '/experimental/disable-tinymce.php';
124 }
125
126 // Load the BC Layer to avoid fatal errors of extenders using the Fonts API.
127 // @core-merge: do not merge the BC layer files into WordPress Core.
128 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-provider.php';
129 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-utils.php';
130 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts.php';
131 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-provider-local.php';
132 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-fonts-resolver.php';
133 require __DIR__ . '/experimental/font-face/bc-layer/class-gutenberg-fonts-api-bc-layer.php';
134 require __DIR__ . '/experimental/font-face/bc-layer/webfonts-deprecations.php';
135 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-utils.php';
136 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-provider.php';
137 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts-provider-local.php';
138 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-webfonts.php';
139 require __DIR__ . '/experimental/font-face/bc-layer/class-wp-web-fonts.php';
140
141 // Plugin specific code.
142 require __DIR__ . '/script-loader.php';
143 require __DIR__ . '/global-styles-and-settings.php';
144 require __DIR__ . '/class-wp-theme-json-data-gutenberg.php';
145 require __DIR__ . '/class-wp-theme-json-gutenberg.php';
146 require __DIR__ . '/class-wp-theme-json-resolver-gutenberg.php';
147 require __DIR__ . '/class-wp-theme-json-schema-gutenberg.php';
148 require __DIR__ . '/class-wp-duotone-gutenberg.php';
149 require __DIR__ . '/blocks.php';
150 require __DIR__ . '/block-editor-settings.php';
151 require __DIR__ . '/client-assets.php';
152 require __DIR__ . '/demo.php';
153 require __DIR__ . '/experiments-page.php';
154 require __DIR__ . '/interactivity-api.php';
155 require __DIR__ . '/block-template-utils.php';
156 if ( gutenberg_is_experiment_enabled( 'gutenberg-full-page-client-side-navigation' ) ) {
157 require __DIR__ . '/experimental/full-page-client-side-navigation.php';
158 }
159
160 // Copied package PHP files.
161 if ( is_dir( __DIR__ . '/../build/style-engine' ) ) {
162 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-declarations-gutenberg.php';
163 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-rule-gutenberg.php';
164 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-css-rules-store-gutenberg.php';
165 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-processor-gutenberg.php';
166 require_once __DIR__ . '/../build/style-engine/class-wp-style-engine-gutenberg.php';
167 require_once __DIR__ . '/../build/style-engine/style-engine-gutenberg.php';
168 }
169
170 // Block supports overrides.
171 require __DIR__ . '/block-supports/settings.php';
172 require __DIR__ . '/block-supports/elements.php';
173 require __DIR__ . '/block-supports/colors.php';
174 require __DIR__ . '/block-supports/typography.php';
175 require __DIR__ . '/block-supports/border.php';
176 require __DIR__ . '/block-supports/layout.php';
177 require __DIR__ . '/block-supports/position.php';
178 require __DIR__ . '/block-supports/spacing.php';
179 require __DIR__ . '/block-supports/dimensions.php';
180 require __DIR__ . '/block-supports/duotone.php';
181 require __DIR__ . '/block-supports/shadow.php';
182 require __DIR__ . '/block-supports/background.php';
183 require __DIR__ . '/block-supports/block-style-variations.php';
184 require __DIR__ . '/block-supports/aria-label.php';
185
186 // Data views.
187 require_once __DIR__ . '/experimental/data-views.php';
188
189 // Client-side media processing.
190 if ( gutenberg_is_experiment_enabled( 'gutenberg-media-processing' ) ) {
191 require_once __DIR__ . '/experimental/media/load.php';
192 }
193