PluginProbe
Gutenberg / 9.3.0
Gutenberg v9.3.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 9.3.0, at lib/load.php

130 lines 4.7 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 /**
13 * Checks whether the Gutenberg experiment is enabled.
14 *
15 * @since 6.7.0
16 *
17 * @param string $name The name of the experiment.
18 *
19 * @return bool True when the experiment is enabled.
20 */
21 function gutenberg_is_experiment_enabled( $name ) {
22 $experiments = get_option( 'gutenberg-experiments' );
23 return ! empty( $experiments[ $name ] );
24 }
25
26 // These files only need to be loaded if within a rest server instance
27 // which this class will exist if that is the case.
28 if ( class_exists( 'WP_REST_Controller' ) ) {
29 /**
30 * Start: Include for phase 2
31 */
32 if ( ! class_exists( 'WP_REST_Sidebars_Controller' ) ) {
33 require_once dirname( __FILE__ ) . '/class-wp-rest-sidebars-controller.php';
34 }
35 if ( ! class_exists( 'WP_REST_Widget_Types_Controller' ) ) {
36 require_once dirname( __FILE__ ) . '/class-wp-rest-widget-types-controller.php';
37 }
38 if ( ! class_exists( 'WP_REST_Widgets_Controller' ) ) {
39 require_once dirname( __FILE__ ) . '/class-wp-rest-widgets-controller.php';
40 }
41 if ( ! class_exists( 'WP_REST_Block_Directory_Controller' ) ) {
42 require dirname( __FILE__ ) . '/class-wp-rest-block-directory-controller.php';
43 }
44 if ( ! class_exists( 'WP_REST_Block_Types_Controller' ) ) {
45 require dirname( __FILE__ ) . '/class-wp-rest-block-types-controller.php';
46 }
47 if ( ! class_exists( 'WP_REST_Menus_Controller' ) ) {
48 require_once dirname( __FILE__ ) . '/class-wp-rest-menus-controller.php';
49 }
50 if ( ! class_exists( 'WP_REST_Menu_Items_Controller' ) ) {
51 require_once dirname( __FILE__ ) . '/class-wp-rest-menu-items-controller.php';
52 }
53 if ( ! class_exists( 'WP_REST_Menu_Locations_Controller' ) ) {
54 require_once dirname( __FILE__ ) . '/class-wp-rest-menu-locations-controller.php';
55 }
56 if ( ! class_exists( 'WP_Rest_Customizer_Nonces' ) ) {
57 require_once dirname( __FILE__ ) . '/class-wp-rest-customizer-nonces.php';
58 }
59 if ( ! class_exists( 'WP_REST_Image_Editor_Controller' ) ) {
60 require dirname( __FILE__ ) . '/class-wp-rest-image-editor-controller.php';
61 }
62 if ( ! class_exists( 'WP_REST_Plugins_Controller' ) ) {
63 require_once dirname( __FILE__ ) . '/class-wp-rest-plugins-controller.php';
64 }
65 if ( ! class_exists( 'WP_REST_Post_Format_Search_Handler' ) ) {
66 require_once dirname( __FILE__ ) . '/class-wp-rest-post-format-search-handler.php';
67 }
68 if ( ! class_exists( 'WP_REST_Term_Search_Handler' ) ) {
69 require_once dirname( __FILE__ ) . '/class-wp-rest-term-search-handler.php';
70 }
71 if ( ! class_exists( 'WP_REST_Batch_Controller' ) ) {
72 require_once dirname( __FILE__ ) . '/class-wp-rest-batch-controller.php';
73 }
74 /**
75 * End: Include for phase 2
76 */
77
78 require dirname( __FILE__ ) . '/rest-api.php';
79 }
80
81 if ( ! class_exists( 'WP_Block_Patterns_Registry' ) ) {
82 require dirname( __FILE__ ) . '/class-wp-block-patterns-registry.php';
83 }
84
85 if ( ! class_exists( 'WP_Block_Pattern_Categories_Registry' ) ) {
86 require dirname( __FILE__ ) . '/class-wp-block-pattern-categories-registry.php';
87 }
88
89 if ( ! class_exists( 'WP_Block' ) ) {
90 require dirname( __FILE__ ) . '/class-wp-block.php';
91 }
92
93 if ( ! class_exists( 'WP_Block_List' ) ) {
94 require dirname( __FILE__ ) . '/class-wp-block-list.php';
95 }
96 if ( ! class_exists( 'WP_Widget_Block' ) ) {
97 require_once dirname( __FILE__ ) . '/class-wp-widget-block.php';
98 }
99 require_once dirname( __FILE__ ) . '/widgets-page.php';
100
101 require dirname( __FILE__ ) . '/compat.php';
102 require dirname( __FILE__ ) . '/utils.php';
103
104 require dirname( __FILE__ ) . '/full-site-editing.php';
105 require dirname( __FILE__ ) . '/templates.php';
106 require dirname( __FILE__ ) . '/template-parts.php';
107 require dirname( __FILE__ ) . '/template-loader.php';
108 require dirname( __FILE__ ) . '/edit-site-page.php';
109 require dirname( __FILE__ ) . '/edit-site-export.php';
110
111 require dirname( __FILE__ ) . '/block-patterns.php';
112 require dirname( __FILE__ ) . '/blocks.php';
113 require dirname( __FILE__ ) . '/client-assets.php';
114 require dirname( __FILE__ ) . '/block-directory.php';
115 require dirname( __FILE__ ) . '/demo.php';
116 require dirname( __FILE__ ) . '/widgets.php';
117 require dirname( __FILE__ ) . '/navigation.php';
118 require dirname( __FILE__ ) . '/navigation-page.php';
119 require dirname( __FILE__ ) . '/experiments-page.php';
120 require dirname( __FILE__ ) . '/global-styles.php';
121
122 if ( ! class_exists( 'WP_Block_Supports' ) ) {
123 require_once dirname( __FILE__ ) . '/class-wp-block-supports.php';
124 }
125 require dirname( __FILE__ ) . '/block-supports/generated-classname.php';
126 require dirname( __FILE__ ) . '/block-supports/colors.php';
127 require dirname( __FILE__ ) . '/block-supports/align.php';
128 require dirname( __FILE__ ) . '/block-supports/typography.php';
129 require dirname( __FILE__ ) . '/block-supports/custom-classname.php';
130