Skip to content

Commit

Permalink
Admin Bar: Make it consistent between Calypso and WP Admin regardless…
Browse files Browse the repository at this point in the history
… of the value of Admin Interface Style (#38362)
  • Loading branch information
arthur791004 authored Jul 17, 2024
1 parent b4e1648 commit ebfa7d3
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Admin Bar: Make it consistent between Calypso and WP Admin regardless of the value of Admin Interface Style
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

use Automattic\Jetpack\Jetpack_Mu_Wpcom;

if ( get_option( 'wpcom_admin_interface' ) !== 'wp-admin' ) {
return;
}
define( 'WPCOM_ADMIN_BAR_UNIFICATION', true );

/**
* Enqueue assets needed by the WordPress.com admin bar.
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/masterbar/changelog/feat-unify-masterbar
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Admin Bar: Make it consistent between Calypso and WP Admin regardless of the value of Admin Interface Style
2 changes: 1 addition & 1 deletion projects/packages/masterbar/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"extra": {
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.3.x-dev"
"dev-trunk": "0.4.x-dev"
},
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-masterbar/compare/v${old}...v${new}"
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/masterbar/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-masterbar",
"version": "0.3.1",
"version": "0.4.0-alpha",
"description": "The WordPress.com Toolbar feature replaces the default admin bar and offers quick links to the Reader, all your sites, your WordPress.com profile, and notifications.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/masterbar/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_admin_color_meta' ) );
}

if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { // Classic sites.
if ( ( defined( 'WPCOM_ADMIN_BAR_UNIFICATION' ) && WPCOM_ADMIN_BAR_UNIFICATION ) || get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { // Classic sites.
add_filter( 'css_do_concat', array( $this, 'disable_css_concat_for_color_schemes' ), 10, 2 );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_color_scheme_for_sidebar_notice' ) );
} else { // Default and self-hosted sites.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ public function enqueue_scripts() {
)
);

// Load nav unification styles when the user isn't using wp-admin interface style.
if ( ! $this->use_wp_admin_interface() ) {
// Load nav unification styles for the admin bar when the user isn't using wp-admin interface style.
if ( ! $this->use_wp_admin_interface() && ! ( defined( 'WPCOM_ADMIN_BAR_UNIFICATION' ) && WPCOM_ADMIN_BAR_UNIFICATION ) ) {
Assets::register_script(
'jetpack-admin-nav-unification',
$assets_base_path . 'admin-menu-nav-unification.js',
Expand Down
4 changes: 2 additions & 2 deletions projects/packages/masterbar/src/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Main {

const PACKAGE_VERSION = '0.3.1';
const PACKAGE_VERSION = '0.4.0-alpha';

/**
* Initializer.
Expand All @@ -29,7 +29,7 @@ public static function init() {

new Admin_Color_Schemes();

if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) {
if ( ( defined( 'WPCOM_ADMIN_BAR_UNIFICATION' ) && WPCOM_ADMIN_BAR_UNIFICATION ) || get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) {
return;
}

Expand Down
5 changes: 5 additions & 0 deletions projects/plugins/jetpack/changelog/feat-unify-masterbar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/jetpack/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/mu-wpcom-plugin/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions projects/plugins/wpcomsh/changelog/feat-unify-masterbar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/wpcomsh/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ebfa7d3

Please sign in to comment.