| @@ -8,60 +8,69 @@ | ||
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 9 | die( 'Silence is golden.' ); |
| 10 | 10 | } |
| 11 | 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 | 12 | // These files only need to be loaded if within a rest server instance |
| 27 | 13 | // which this class will exist if that is the case. |
| 28 | 14 | if ( class_exists( 'WP_REST_Controller' ) ) { |
| 29 | - /** | |
| 30 | - * Start: Include for phase 2 | |
| 31 | - */ | |
| 32 | - if ( ! class_exists( 'WP_REST_Widget_Forms' ) ) { | |
| 33 | - require dirname( __FILE__ ) . '/class-wp-rest-widget-forms.php'; | |
| 15 | + if ( ! class_exists( 'WP_REST_Blocks_Controller' ) ) { | |
| 16 | + require dirname( __FILE__ ) . '/class-wp-rest-blocks-controller.php'; | |
| 34 | 17 | } |
| 35 | - if ( ! class_exists( 'WP_REST_Widget_Areas_Controller' ) ) { | |
| 36 | - require dirname( __FILE__ ) . '/class-experimental-wp-widget-blocks-manager.php'; | |
| 37 | - require dirname( __FILE__ ) . '/class-wp-rest-widget-areas-controller.php'; | |
| 18 | + if ( ! class_exists( 'WP_REST_Autosaves_Controller' ) ) { | |
| 19 | + require dirname( __FILE__ ) . '/class-wp-rest-autosaves-controller.php'; | |
| 38 | 20 | } |
| 39 | - if ( ! class_exists( 'WP_REST_Block_Directory_Controller' ) ) { | |
| 40 | - require dirname( __FILE__ ) . '/class-wp-rest-block-directory-controller.php'; | |
| 21 | + if ( ! class_exists( 'WP_REST_Themes_Controller' ) ) { | |
| 22 | + require dirname( __FILE__ ) . '/class-wp-rest-themes-controller.php'; | |
| 41 | 23 | } |
| 42 | - /** | |
| 43 | - * End: Include for phase 2 | |
| 44 | - */ | |
| 24 | + if ( ! class_exists( 'WP_REST_Block_Renderer_Controller' ) ) { | |
| 25 | + require dirname( __FILE__ ) . '/class-wp-rest-block-renderer-controller.php'; | |
| 26 | + } | |
| 27 | + if ( ! class_exists( 'WP_REST_Search_Controller' ) ) { | |
| 28 | + require dirname( __FILE__ ) . '/class-wp-rest-search-controller.php'; | |
| 29 | + } | |
| 30 | + if ( ! class_exists( 'WP_REST_Search_Handler' ) ) { | |
| 31 | + require dirname( __FILE__ ) . '/class-wp-rest-search-handler.php'; | |
| 32 | + } | |
| 33 | + if ( ! class_exists( 'WP_REST_Post_Search_Handler' ) ) { | |
| 34 | + require dirname( __FILE__ ) . '/class-wp-rest-post-search-handler.php'; | |
| 35 | + } | |
| 45 | 36 | |
| 46 | 37 | require dirname( __FILE__ ) . '/rest-api.php'; |
| 47 | 38 | } |
| 48 | 39 | |
| 49 | -if ( ! class_exists( 'WP_Block_Styles_Registry' ) ) { | |
| 50 | - require dirname( __FILE__ ) . '/class-wp-block-styles-registry.php'; | |
| 40 | +require dirname( __FILE__ ) . '/meta-box-partial-page.php'; | |
| 41 | +if ( ! class_exists( 'WP_Block_Type' ) ) { | |
| 42 | + require dirname( __FILE__ ) . '/class-wp-block-type.php'; | |
| 51 | 43 | } |
| 44 | +if ( ! class_exists( 'WP_Block_Type_Registry' ) ) { | |
| 45 | + require dirname( __FILE__ ) . '/class-wp-block-type-registry.php'; | |
| 46 | +} | |
| 47 | +require dirname( __FILE__ ) . '/blocks.php'; | |
| 48 | +require dirname( __FILE__ ) . '/client-assets.php'; | |
| 49 | +require dirname( __FILE__ ) . '/compat.php'; | |
| 50 | +require dirname( __FILE__ ) . '/plugin-compat.php'; | |
| 51 | +require dirname( __FILE__ ) . '/i18n.php'; | |
| 52 | +require dirname( __FILE__ ) . '/register.php'; | |
| 52 | 53 | |
| 53 | -require dirname( __FILE__ ) . '/compat.php'; | |
| 54 | 54 | |
| 55 | -require dirname( __FILE__ ) . '/blocks.php'; | |
| 56 | -require dirname( __FILE__ ) . '/templates.php'; | |
| 57 | -require dirname( __FILE__ ) . '/template-parts.php'; | |
| 58 | -require dirname( __FILE__ ) . '/template-loader.php'; | |
| 59 | -require dirname( __FILE__ ) . '/client-assets.php'; | |
| 60 | -require dirname( __FILE__ ) . '/block-directory.php'; | |
| 61 | -require dirname( __FILE__ ) . '/demo.php'; | |
| 62 | -require dirname( __FILE__ ) . '/widgets.php'; | |
| 63 | -require dirname( __FILE__ ) . '/widgets-page.php'; | |
| 64 | -require dirname( __FILE__ ) . '/experiments-page.php'; | |
| 65 | -require dirname( __FILE__ ) . '/customizer.php'; | |
| 66 | -require dirname( __FILE__ ) . '/edit-site-page.php'; | |
| 67 | -require dirname( __FILE__ ) . '/global-styles.php'; | |
| 55 | +// Register server-side code for individual blocks. | |
| 56 | +if ( ! function_exists( 'render_block_core_archives' ) ) { | |
| 57 | + require dirname( __FILE__ ) . '/../packages/block-library/src/archives/index.php'; | |
| 58 | +} | |
| 59 | +if ( ! function_exists( 'render_block_core_block' ) ) { | |
| 60 | + require dirname( __FILE__ ) . '/../packages/block-library/src/block/index.php'; | |
| 61 | +} | |
| 62 | +if ( ! function_exists( 'render_block_core_categories' ) ) { | |
| 63 | + require dirname( __FILE__ ) . '/../packages/block-library/src/categories/index.php'; | |
| 64 | +} | |
| 65 | +// Currently merged in core as `gutenberg_render_block_core_latest_comments`, | |
| 66 | +// expected to change soon. | |
| 67 | +if ( ! function_exists( 'render_block_core_latest_comments' ) | |
| 68 | + && ! function_exists( 'gutenberg_render_block_core_latest_comments' ) ) { | |
| 69 | + require dirname( __FILE__ ) . '/../packages/block-library/src/latest-comments/index.php'; | |
| 70 | +} | |
| 71 | +if ( ! function_exists( 'render_block_core_latest_posts' ) ) { | |
| 72 | + require dirname( __FILE__ ) . '/../packages/block-library/src/latest-posts/index.php'; | |
| 73 | +} | |
| 74 | +if ( ! function_exists( 'render_block_core_shortcode' ) ) { | |
| 75 | + require dirname( __FILE__ ) . '/../packages/block-library/src/shortcode/index.php'; | |
| 76 | +} | |