PluginProbe
Gutenberg / 24.0.0
Gutenberg v24.0.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

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

30 lines 906 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Extensible Site Editor experiment integration.
4 *
5 * Only loaded while the `gutenberg-extensible-site-editor` experiment is
6 * enabled (see lib/load.php).
7 *
8 * @package gutenberg
9 */
10
11 /**
12 * Redirect the Appearance > Design menu to the extensible site editor.
13 *
14 * @global array $submenu WordPress admin submenu array.
15 */
16 function gutenberg_redirect_to_extensible_site_editor() {
17 // Update the Design submenu item to point to the extensible site editor.
18 global $submenu;
19 if ( $submenu && isset( $submenu['themes.php'] ) ) {
20 foreach ( $submenu['themes.php'] as $key => $item ) {
21 // Find the Design/site-editor menu item and update its URL.
22 if ( isset( $item[2] ) && 'site-editor.php' === $item[2] ) {
23 $submenu['themes.php'][ $key ][2] = 'admin.php?page=site-editor-v2';
24 break;
25 }
26 }
27 }
28 }
29 add_action( 'admin_menu', 'gutenberg_redirect_to_extensible_site_editor', 100 );
30