PluginProbe
Gutenberg / 20.2.0
Gutenberg v20.2.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.2.0, at lib/load.php

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