PluginProbe
Gutenberg / 23.2.0
Gutenberg v23.2.0
24.0.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 All 403 releases
gutenberg / lib / experimental / extensible-site-editor.php
lib/experimental
connectors 3 months ago content-types 3 months ago dashboard-widgets 3 months ago experiments 3 months ago font-face 1 year ago guidelines 3 months ago interactivity-api 1 year ago media-editor 3 months ago pages 6 months ago block-editor-settings-mobile.php 888 B 2 years ago blocks.php 4.4 KB 7 months ago class-gutenberg-hierarchical-sort.php 4.7 KB 6 months ago class-wp-rest-block-editor-settings-controller.php 24.2 KB 7 months ago editor-settings.php 3.3 KB 3 months ago extensible-site-editor.php 975 B 7 months ago kses-allowed-html.php 965 B 1 year ago kses.php 6.2 KB 5 months ago navigation-theme-opt-in.php 13.3 KB 6 months ago rest-api-overrides.php 1.6 KB 9 months ago rest-api.php 3.2 KB 7 months ago script-modules.php 7.9 KB 6 months ago workflow-palette.php 355 B 9 months ago

extensible-site-editor.php in Gutenberg 23.2.0, at lib/experimental/extensible-site-editor.php

33 lines 975 B Raw Download Zip
1 <?php
2 /**
3 * Extensible Site Editor experiment integration.
4 *
5 * @package gutenberg
6 */
7
8 /**
9 * Redirect the Appearance > Design menu to the extensible site editor
10 * when the experiment is enabled.
11 *
12 * @global array $submenu WordPress admin submenu array.
13 */
14 function gutenberg_redirect_to_extensible_site_editor() {
15 // Only proceed if the experiment is enabled.
16 if ( ! gutenberg_is_experiment_enabled( 'gutenberg-extensible-site-editor' ) ) {
17 return;
18 }
19
20 // Update the Design submenu item to point to the extensible site editor.
21 global $submenu;
22 if ( $submenu && isset( $submenu['themes.php'] ) ) {
23 foreach ( $submenu['themes.php'] as $key => $item ) {
24 // Find the Design/site-editor menu item and update its URL.
25 if ( isset( $item[2] ) && 'site-editor.php' === $item[2] ) {
26 $submenu['themes.php'][ $key ][2] = 'admin.php?page=site-editor-v2';
27 break;
28 }
29 }
30 }
31 }
32 add_action( 'admin_menu', 'gutenberg_redirect_to_extensible_site_editor', 100 );
33