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

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