PluginProbe
Gutenberg / 22.9.0
Gutenberg v22.9.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 / experimental / connectors / load.php

load.php in Gutenberg 22.9.0, at lib/experimental/connectors/load.php

38 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Bootstraps the Connectors page in wp-admin.
4 *
5 * @package gutenberg
6 */
7
8 // Priority 11 to run after Core's menu.php sets up the connectors menu.
9 add_action( 'admin_menu', '_gutenberg_connectors_add_settings_menu_item', 11 );
10
11 /**
12 * Registers the Connectors menu item under Settings.
13 * Removes Core's connectors menu item first to prevent duplication.
14 *
15 * @access private
16 */
17 function _gutenberg_connectors_add_settings_menu_item(): void {
18 if ( ! class_exists( '\WordPress\AiClient\AiClient' ) || ! function_exists( 'gutenberg_options_connectors_wp_admin_render_page' ) ) {
19 return;
20 }
21
22 // Remove Core's connectors menu item if it exists.
23 remove_submenu_page( 'options-general.php', 'connectors-wp-admin' );
24 remove_submenu_page( 'options-general.php', 'options-connectors.php' );
25
26 add_submenu_page(
27 'options-general.php',
28 __( 'Connectors', 'gutenberg' ),
29 __( 'Connectors', 'gutenberg' ),
30 'manage_options',
31 'options-connectors-wp-admin',
32 'gutenberg_options_connectors_wp_admin_render_page',
33 1
34 );
35 }
36
37 require __DIR__ . '/default-connectors.php';
38