Skip to content

Commit

Permalink
MU WPCOM: Remove admin bar launch button from greylisted sites (#41340)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and matticbot committed Jan 28, 2025
1 parent 40ef392 commit 9c05a70
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 89 deletions.
60 changes: 30 additions & 30 deletions 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
Expand Up @@ -11,9 +11,25 @@
* @param WP_Admin_Bar $admin_bar The WordPress admin bar.
*/
function wpcom_add_launch_button_to_admin_bar( WP_Admin_Bar $admin_bar ) {
$current_blog_id = get_current_blog_id();

if ( function_exists( 'is_graylisted' ) && is_graylisted( $current_blog_id ) ) {
return false;
}

if ( ! current_user_can( 'manage_options' ) ) {
return;
}

if ( function_exists( 'has_blog_sticker' ) && has_blog_sticker( 'difm-lite-in-progress' ) ) {
return false;
}

// No button for agency-managed sites.
if ( ! empty( get_option( 'is_fully_managed_agency_site' ) ) ) {
return false;
}

$is_launched = get_option( 'launch-status' ) !== 'unlaunched';
if ( $is_launched ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
),
'jetpack-mu-wpcom' => array(
'path' => 'jetpack_vendor/automattic/jetpack-mu-wpcom',
'ver' => '6.2.0-alpha1738057754',
'ver' => '6.2.0-alpha1738061274',
),
'jetpack-password-checker' => array(
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',
Expand Down
Loading

0 comments on commit 9c05a70

Please sign in to comment.