From 0e5bc5afb789940737b57e2b20691cc8c74712a0 Mon Sep 17 00:00:00 2001 From: Karen Attfield Date: Wed, 28 Aug 2024 16:00:59 +0100 Subject: [PATCH] Admin menu: Change order of Jetpack sub-menu items (#39095) --- .../changelog/update-jetpack-menu-item-order | 4 ++ .../admin-ui/src/class-admin-menu.php | 2 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../backup/src/class-jetpack-backup.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../my-jetpack/src/class-activitylog.php | 2 +- .../my-jetpack/src/class-jetpack-manage.php | 2 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../search/src/dashboard/class-dashboard.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../videopress/src/class-admin-ui.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../wordads/src/dashboard/class-dashboard.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ projects/plugins/beta/src/class-admin.php | 3 +- .../plugins/boost/app/admin/class-admin.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ projects/plugins/jetpack/_inc/client/main.jsx | 63 +++++++++++++++++-- .../admin-pages/class.jetpack-react-page.php | 35 ++++++++++- .../changelog/update-jetpack-menu-item-order | 4 ++ .../plugins/jetpack/class.jetpack-admin.php | 1 + .../modules/scan/class-admin-sidebar-link.php | 36 ++++++++--- .../plugins/jetpack/modules/subscriptions.php | 9 +-- .../changelog/update-jetpack-menu-item-order | 4 ++ .../protect/src/class-jetpack-protect.php | 3 +- .../changelog/update-jetpack-menu-item-order | 4 ++ .../social/src/class-jetpack-social.php | 3 +- 27 files changed, 186 insertions(+), 32 deletions(-) create mode 100644 projects/packages/admin-ui/changelog/update-jetpack-menu-item-order create mode 100644 projects/packages/backup/changelog/update-jetpack-menu-item-order create mode 100644 projects/packages/my-jetpack/changelog/update-jetpack-menu-item-order create mode 100644 projects/packages/search/changelog/update-jetpack-menu-item-order create mode 100644 projects/packages/videopress/changelog/update-jetpack-menu-item-order create mode 100644 projects/packages/wordads/changelog/update-jetpack-menu-item-order create mode 100644 projects/plugins/beta/changelog/update-jetpack-menu-item-order create mode 100644 projects/plugins/boost/changelog/update-jetpack-menu-item-order create mode 100644 projects/plugins/jetpack/changelog/update-jetpack-menu-item-order create mode 100644 projects/plugins/protect/changelog/update-jetpack-menu-item-order create mode 100644 projects/plugins/social/changelog/update-jetpack-menu-item-order diff --git a/projects/packages/admin-ui/changelog/update-jetpack-menu-item-order b/projects/packages/admin-ui/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/admin-ui/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/admin-ui/src/class-admin-menu.php b/projects/packages/admin-ui/src/class-admin-menu.php index caa7ceed4a461..200c7fd23a182 100644 --- a/projects/packages/admin-ui/src/class-admin-menu.php +++ b/projects/packages/admin-ui/src/class-admin-menu.php @@ -58,7 +58,7 @@ function () { remove_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); // Add an Anti-spam menu item for Jetpack. - self::add_menu( __( 'Akismet Anti-spam', 'jetpack-admin-ui' ), __( 'Akismet Anti-spam', 'jetpack-admin-ui' ), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) ); + self::add_menu( __( 'Akismet Anti-spam', 'jetpack-admin-ui' ), __( 'Akismet Anti-spam', 'jetpack-admin-ui' ), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ), 6 ); }, 4 ); diff --git a/projects/packages/backup/changelog/update-jetpack-menu-item-order b/projects/packages/backup/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/backup/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/backup/src/class-jetpack-backup.php b/projects/packages/backup/src/class-jetpack-backup.php index d75fb1717eaf7..b6e0fd3bafad7 100644 --- a/projects/packages/backup/src/class-jetpack-backup.php +++ b/projects/packages/backup/src/class-jetpack-backup.php @@ -124,7 +124,8 @@ public static function initialize() { _x( 'VaultPress Backup', 'The Jetpack VaultPress Backup product name, without the Jetpack prefix', 'jetpack-backup-pkg' ), 'manage_options', 'jetpack-backup', - array( __CLASS__, 'plugin_settings_page' ) + array( __CLASS__, 'plugin_settings_page' ), + 7 ); add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) ); diff --git a/projects/packages/my-jetpack/changelog/update-jetpack-menu-item-order b/projects/packages/my-jetpack/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/my-jetpack/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/my-jetpack/src/class-activitylog.php b/projects/packages/my-jetpack/src/class-activitylog.php index 0e59226dbd508..4de90c075ded5 100644 --- a/projects/packages/my-jetpack/src/class-activitylog.php +++ b/projects/packages/my-jetpack/src/class-activitylog.php @@ -51,7 +51,7 @@ public static function add_submenu_jetpack() { 'manage_options', esc_url( Redirect::get_url( 'cloud-activity-log-wp-menu', $args ) ), null, - 1 + 8 ); } } diff --git a/projects/packages/my-jetpack/src/class-jetpack-manage.php b/projects/packages/my-jetpack/src/class-jetpack-manage.php index be32839498d54..3a732192c90a9 100644 --- a/projects/packages/my-jetpack/src/class-jetpack-manage.php +++ b/projects/packages/my-jetpack/src/class-jetpack-manage.php @@ -49,7 +49,7 @@ public static function add_submenu_jetpack() { 'manage_options', esc_url( Redirect::get_url( 'cloud-manage-dashboard-wp-menu', $args ) ), null, - 100 + 15 ); } diff --git a/projects/packages/search/changelog/update-jetpack-menu-item-order b/projects/packages/search/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/search/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/search/src/dashboard/class-dashboard.php b/projects/packages/search/src/dashboard/class-dashboard.php index 8da1e6ea86254..ac6494edc6f23 100644 --- a/projects/packages/search/src/dashboard/class-dashboard.php +++ b/projects/packages/search/src/dashboard/class-dashboard.php @@ -102,7 +102,8 @@ public function add_wp_admin_submenu() { _x( 'Search', 'product name shown in menu', 'jetpack-search-pkg' ), 'manage_options', 'jetpack-search', - array( $this, 'render' ) + array( $this, 'render' ), + 10 ); } else { // always add the page, but hide it from the menu. diff --git a/projects/packages/videopress/changelog/update-jetpack-menu-item-order b/projects/packages/videopress/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/videopress/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/videopress/src/class-admin-ui.php b/projects/packages/videopress/src/class-admin-ui.php index 6c5784fd31b74..ef5182a691076 100644 --- a/projects/packages/videopress/src/class-admin-ui.php +++ b/projects/packages/videopress/src/class-admin-ui.php @@ -39,7 +39,8 @@ public static function init() { _x( 'VideoPress', 'The Jetpack VideoPress product name, without the Jetpack prefix', 'jetpack-videopress-pkg' ), 'manage_options', self::ADMIN_PAGE_SLUG, - array( __CLASS__, 'plugin_settings_page' ) + array( __CLASS__, 'plugin_settings_page' ), + 3 ); add_action( 'load-' . $page_suffix, array( __CLASS__, 'admin_init' ) ); diff --git a/projects/packages/wordads/changelog/update-jetpack-menu-item-order b/projects/packages/wordads/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/packages/wordads/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/packages/wordads/src/dashboard/class-dashboard.php b/projects/packages/wordads/src/dashboard/class-dashboard.php index c493211f7c4c0..6ee2bd5c58171 100644 --- a/projects/packages/wordads/src/dashboard/class-dashboard.php +++ b/projects/packages/wordads/src/dashboard/class-dashboard.php @@ -55,7 +55,8 @@ public function add_wp_admin_submenu() { _x( 'WordAds', 'product name shown in menu', 'jetpack-wordads' ), 'manage_options', 'jetpack-wordads', - array( $this, 'render' ) + array( $this, 'render' ), + 12 ); add_action( 'load-' . $page_suffix, array( $this, 'admin_init' ) ); diff --git a/projects/plugins/beta/changelog/update-jetpack-menu-item-order b/projects/plugins/beta/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/plugins/beta/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/plugins/beta/src/class-admin.php b/projects/plugins/beta/src/class-admin.php index b17a94535a58b..c9351fc22151a 100644 --- a/projects/plugins/beta/src/class-admin.php +++ b/projects/plugins/beta/src/class-admin.php @@ -41,7 +41,8 @@ public static function add_actions() { 'Beta Tester', 'update_plugins', 'jetpack-beta', - array( self::class, 'render' ) + array( self::class, 'render' ), + 16 ); if ( false !== self::$hookname ) { diff --git a/projects/plugins/boost/app/admin/class-admin.php b/projects/plugins/boost/app/admin/class-admin.php index 1819b5401bcf4..733da5d4638ee 100644 --- a/projects/plugins/boost/app/admin/class-admin.php +++ b/projects/plugins/boost/app/admin/class-admin.php @@ -53,7 +53,8 @@ public function handle_admin_menu() { $menu_label, 'manage_options', JETPACK_BOOST_SLUG, - array( $this, 'render_settings' ) + array( $this, 'render_settings' ), + 2 ); add_action( 'load-' . $page_suffix, array( $this, 'admin_init' ) ); } diff --git a/projects/plugins/boost/changelog/update-jetpack-menu-item-order b/projects/plugins/boost/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/plugins/boost/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/plugins/jetpack/_inc/client/main.jsx b/projects/plugins/jetpack/_inc/client/main.jsx index 9fc2f3f7c103c..a46348b9bcc66 100644 --- a/projects/plugins/jetpack/_inc/client/main.jsx +++ b/projects/plugins/jetpack/_inc/client/main.jsx @@ -960,14 +960,69 @@ export default connect( } )( withRouter( Main ) ) ); +// eslint-disable-next-line jsdoc/require-returns-check +/** + * Determines the page order of My Jetpack, Activity Log, Dashboard, and Settings in the left sidebar. + * @return {object} Object with keys for each page and values for the order of the page in the sidebar. + */ +function jetpackPageOrder() { + const jetpackParentMenu = document.querySelector( '#toplevel_page_jetpack' ); + const pageOrder = {}; + + if ( jetpackParentMenu ) { + const jetpackSubMenu = jetpackParentMenu.querySelector( '.wp-submenu' ); + + if ( jetpackSubMenu ) { + const subMenuItems = jetpackSubMenu.querySelectorAll( 'li:not(.wp-submenu-head) a' ); + + const urlPatterns = [ + { + key: 'dashboard', + pattern: '/wp-admin/admin.php?page=jetpack#/dashboard', + matchType: 'end', + }, + { + key: 'activityLog', + pattern: 'https://jetpack.com/redirect/?source=cloud-activity-log-wp-menu', + matchType: 'start', + }, + { + key: 'settings', + pattern: '/wp-admin/admin.php?page=jetpack#/settings', + matchType: 'end', + }, + ]; + + const findIndex = ( urlPattern, matchType ) => { + let foundIndex = -1; + subMenuItems.forEach( ( item, index ) => { + const href = item.href; + if ( + ( matchType === 'end' && href.endsWith( urlPattern ) ) || + ( matchType === 'start' && href.startsWith( urlPattern ) ) + ) { + foundIndex = index + 1; + } + } ); + return foundIndex; + }; + + urlPatterns.forEach( ( { key, pattern, matchType } ) => { + const index = findIndex( pattern, matchType ); + pageOrder[ key ] = index; + } ); + return pageOrder; + } + } +} + /** * Manages changing the visuals of the sub-nav items on the left sidebar when the React app changes routes * - * @param pageOrder */ -window.wpNavMenuClassChange = function ( - pageOrder = { myJetpack: 1, activityLog: 2, dashboard: 3, settings: 4 } -) { +window.wpNavMenuClassChange = function () { + const pageOrder = jetpackPageOrder(); + let hash = window.location.hash; let page = new URLSearchParams( window.location.search ); diff --git a/projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-react-page.php b/projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-react-page.php index 56b96499d14a4..428108f4dcf3d 100644 --- a/projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-react-page.php +++ b/projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-react-page.php @@ -1,5 +1,6 @@ is_offline_mode() + || Jetpack::is_connection_ready() + ) { + remove_submenu_page( 'jetpack', 'jetpack' ); + } + } + /** * Add Jetpack Dashboard sub-link and point it to AAG if the user can view stats, manage modules or if Protect is active. * @@ -86,8 +102,14 @@ public function add_page_actions( $hook ) { */ public function jetpack_add_dashboard_sub_nav_item() { if ( ( new Status() )->is_offline_mode() || Jetpack::is_connection_ready() ) { - add_submenu_page( 'jetpack', __( 'Dashboard', 'jetpack' ), __( 'Dashboard', 'jetpack' ), 'jetpack_admin_page', 'jetpack#/dashboard', '__return_null', 1 ); - remove_submenu_page( 'jetpack', 'jetpack' ); + Admin_Menu::add_menu( + __( 'Dashboard', 'jetpack' ), + __( 'Dashboard', 'jetpack' ), + 'jetpack_admin_page', + Jetpack::admin_url( array( 'page' => 'jetpack#/dashboard' ) ), + null, // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- See https://core.trac.wordpress.org/ticket/52539. + 14 + ); } } @@ -165,7 +187,14 @@ private function can_access_settings() { */ public function jetpack_add_settings_sub_nav_item() { if ( $this->can_access_settings() ) { - add_submenu_page( 'jetpack', __( 'Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'jetpack_admin_page', 'jetpack#/settings', '__return_null' ); + Admin_Menu::add_menu( + __( 'Settings', 'jetpack' ), + __( 'Settings', 'jetpack' ), + 'jetpack_admin_page', + Jetpack::admin_url( array( 'page' => 'jetpack#/settings' ) ), + null, // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- See https://core.trac.wordpress.org/ticket/52539. + 13 + ); } } diff --git a/projects/plugins/jetpack/changelog/update-jetpack-menu-item-order b/projects/plugins/jetpack/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..c96aa7333e16a --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Admin menu: Change order of Jetpack sub-menu items diff --git a/projects/plugins/jetpack/class.jetpack-admin.php b/projects/plugins/jetpack/class.jetpack-admin.php index 73e437c1d83f3..60e1af1fd3747 100644 --- a/projects/plugins/jetpack/class.jetpack-admin.php +++ b/projects/plugins/jetpack/class.jetpack-admin.php @@ -64,6 +64,7 @@ private function __construct() { add_action( 'admin_init', array( $jetpack_react, 'react_redirects' ), 0 ); add_action( 'admin_menu', array( $jetpack_react, 'add_actions' ), 998 ); + add_action( 'admin_menu', array( $jetpack_react, 'remove_jetpack_menu' ), 2000 ); add_action( 'jetpack_admin_menu', array( $jetpack_react, 'jetpack_add_dashboard_sub_nav_item' ) ); add_action( 'jetpack_admin_menu', array( $jetpack_react, 'jetpack_add_settings_sub_nav_item' ) ); add_action( 'jetpack_admin_menu', array( $this, 'admin_menu_debugger' ) ); diff --git a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php index 925b1050b0ca9..2c78af6ba64e5 100644 --- a/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php +++ b/projects/plugins/jetpack/modules/scan/class-admin-sidebar-link.php @@ -7,6 +7,7 @@ namespace Automattic\Jetpack\Scan; +use Automattic\Jetpack\Admin_UI\Admin_Menu; use Automattic\Jetpack\My_Jetpack\Products\Backup; use Automattic\Jetpack\Redirect; use Automattic\Jetpack\Status\Host; @@ -68,22 +69,37 @@ public function maybe_add_admin_link() { } if ( $this->should_show_scan() ) { - $menu_label = __( 'Scan', 'jetpack' ); - $url = Redirect::get_url( 'calypso-scanner' ); - add_submenu_page( 'jetpack', $menu_label, esc_html( $menu_label ) . ' ', 'manage_options', esc_url( $url ), null, $this->get_link_offset() ); + Admin_Menu::add_menu( + __( 'Scan', 'jetpack' ), + __( 'Scan', 'jetpack' ) . ' ', + 'manage_options', + esc_url( Redirect::get_url( 'cloud-scan-history-wp-menu' ) ), + null, + $this->get_link_offset() + ); } // Add scan item which shows history page only. This is mutally exclusive from the scan item above and is only shown for Atomic sitse. if ( $this->should_show_scan_history_only() ) { - $menu_label = __( 'Scan', 'jetpack' ); - $url = Redirect::get_url( 'cloud-scan-history-wp-menu' ); - add_submenu_page( 'jetpack', $menu_label, esc_html( $menu_label ) . ' ', 'manage_options', esc_url( $url ), null, $this->get_link_offset() ); + Admin_Menu::add_menu( + __( 'Scan', 'jetpack' ), + __( 'Scan', 'jetpack' ) . ' ', + 'manage_options', + esc_url( Redirect::get_url( 'cloud-scan-history-wp-menu' ) ), + null, + $this->get_link_offset() + ); } if ( $this->should_show_backup() ) { - $menu_label = __( 'VaultPress', 'jetpack' ); - $url = Redirect::get_url( 'calypso-backups' ); - add_submenu_page( 'jetpack', $menu_label, esc_html( $menu_label ) . ' ', 'manage_options', esc_url( $url ), null, $this->get_link_offset() ); + Admin_Menu::add_menu( + __( 'VaultPress', 'jetpack' ), + __( 'VaultPress', 'jetpack' ) . ' ', + 'manage_options', + esc_url( Redirect::get_url( 'calypso-backups' ) ), + null, + $this->get_link_offset() + ); } } @@ -96,7 +112,7 @@ public function maybe_add_admin_link() { */ private function get_link_offset() { global $submenu; - $offset = 0; + $offset = 9; if ( ! array_key_exists( 'jetpack', $submenu ) ) { return $offset; diff --git a/projects/plugins/jetpack/modules/subscriptions.php b/projects/plugins/jetpack/modules/subscriptions.php index a67cb3fd27148..87801f8868919 100644 --- a/projects/plugins/jetpack/modules/subscriptions.php +++ b/projects/plugins/jetpack/modules/subscriptions.php @@ -15,6 +15,7 @@ // phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files. +use Automattic\Jetpack\Admin_UI\Admin_Menu; use Automattic\Jetpack\Connection\Manager as Connection_Manager; use Automattic\Jetpack\Connection\XMLRPC_Async_Call; use Automattic\Jetpack\Redirect; @@ -1000,13 +1001,13 @@ public function add_subscribers_menu() { array( 'site' => $blog_id ? $blog_id : $status->get_site_suffix() ) ); - add_submenu_page( - 'jetpack', - esc_attr__( 'Subscribers', 'jetpack' ), + Admin_Menu::add_menu( + __( 'Subscribers', 'jetpack' ), __( 'Subscribers', 'jetpack' ) . ' ', 'manage_options', esc_url( $link ), - null + null, + 11 ); } diff --git a/projects/plugins/protect/changelog/update-jetpack-menu-item-order b/projects/plugins/protect/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/plugins/protect/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/plugins/protect/src/class-jetpack-protect.php b/projects/plugins/protect/src/class-jetpack-protect.php index 300886a9bed03..b2db8472267ea 100644 --- a/projects/plugins/protect/src/class-jetpack-protect.php +++ b/projects/plugins/protect/src/class-jetpack-protect.php @@ -156,7 +156,8 @@ public function admin_page_init() { $menu_label, 'manage_options', 'jetpack-protect', - array( $this, 'plugin_settings_page' ) + array( $this, 'plugin_settings_page' ), + 5 ); add_action( 'load-' . $page_suffix, array( $this, 'enqueue_admin_scripts' ) ); diff --git a/projects/plugins/social/changelog/update-jetpack-menu-item-order b/projects/plugins/social/changelog/update-jetpack-menu-item-order new file mode 100644 index 0000000000000..4bfbd859ba2bf --- /dev/null +++ b/projects/plugins/social/changelog/update-jetpack-menu-item-order @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Admin menu: change order of Jetpack sub-menu items diff --git a/projects/plugins/social/src/class-jetpack-social.php b/projects/plugins/social/src/class-jetpack-social.php index 60c80835cdced..9a4954d4c55eb 100644 --- a/projects/plugins/social/src/class-jetpack-social.php +++ b/projects/plugins/social/src/class-jetpack-social.php @@ -52,7 +52,8 @@ public function __construct( $connection_manager = null ) { _x( 'Social', 'The Jetpack Social product name, without the Jetpack prefix', 'jetpack-social' ), 'manage_options', 'jetpack-social', - array( $this, 'plugin_settings_page' ) + array( $this, 'plugin_settings_page' ), + 4 ); add_action( 'load-' . $page_suffix, array( $this, 'admin_init' ) );