diff --git a/projects/plugins/wpcomsh/README.md b/projects/plugins/wpcomsh/README.md index 8aee84281cb07..1ad5b083f4027 100644 --- a/projects/plugins/wpcomsh/README.md +++ b/projects/plugins/wpcomsh/README.md @@ -298,7 +298,6 @@ The Coming Soon PCYsg-u4S-p2 mode is provided via the jetpack-mu-wpcom package P Provides a series of customisations to enable the full Nav Unification experience on Atomic (see pbAPfg-Ou-p2). Includes: -- force enable Masterbar module. - hide admin color scheme picker and add notice pointing to WordPress.com Account Settings. - persist important WP.com user data to user_option via Jetpack connected user data. - activate the Nav Unification feature shipped in Jetpack on Atomic. diff --git a/projects/plugins/wpcomsh/changelog/update-wpcomsh-remove-masterbar-module-references b/projects/plugins/wpcomsh/changelog/update-wpcomsh-remove-masterbar-module-references new file mode 100644 index 0000000000000..de41d1e913c2a --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-wpcomsh-remove-masterbar-module-references @@ -0,0 +1,4 @@ +Significance: minor +Type: removed + +Wpcomsh: Remove actions and filters related to the Masterbar module diff --git a/projects/plugins/wpcomsh/feature-plugins/masterbar.php b/projects/plugins/wpcomsh/feature-plugins/masterbar.php index f0054f12a471d..504a254c0427a 100644 --- a/projects/plugins/wpcomsh/feature-plugins/masterbar.php +++ b/projects/plugins/wpcomsh/feature-plugins/masterbar.php @@ -8,52 +8,6 @@ use Automattic\Jetpack\Connection\Manager as Connection_Manager; -/** - * Force-enable the Masterbar module - * If you use a version of Jetpack that supports it, - * and if it is not already enabled. - */ -function wpcomsh_activate_masterbar_module() { - if ( ! defined( 'JETPACK__VERSION' ) || get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { - return; - } - - if ( ! Jetpack::is_module_active( 'masterbar' ) ) { - Jetpack::activate_module( 'masterbar', false, false ); - } -} -add_action( 'init', 'wpcomsh_activate_masterbar_module', 0, 0 ); - -/** - * Disable the Masterbar for nav redesign. - * - * @param array $modules Array of Jetpack modules. - * @return array - */ -function atomic_masterbar_filter_jetpack_modules( $modules ) { - if ( isset( $modules['masterbar'] ) && get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { - unset( $modules['masterbar'] ); - } - - return $modules; -} -add_filter( 'jetpack_get_available_modules', 'atomic_masterbar_filter_jetpack_modules' ); - -/** - * Remove Masterbar from the old Module list. - * Available at wp-admin/admin.php?page=jetpack_modules - * - * @param array $items Array of Jetpack modules. - * @return array - */ -function wpcomsh_rm_masterbar_module_list( $items ) { - if ( isset( $items['masterbar'] ) ) { - unset( $items['masterbar'] ); - } - return $items; -} -add_filter( 'jetpack_modules_list_table_items', 'wpcomsh_rm_masterbar_module_list' ); - /** * Check if the current request is an API request to the `wpcom/v2/admin-menu` endpoint. *