Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion projects/plugins/wpcomsh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: removed

Wpcomsh: Remove actions and filters related to the Masterbar module
46 changes: 0 additions & 46 deletions projects/plugins/wpcomsh/feature-plugins/masterbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down