PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.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 All 404 releases
gutenberg / lib / compat / plugin / connectors.php

connectors.php in Gutenberg trunk, at lib/compat/plugin/connectors.php

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