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 Jan 28, 2025
1 parent fc53f8f commit 4da10aa
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: restore an early return


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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: restore an early return


5 changes: 5 additions & 0 deletions projects/plugins/wpcomsh/changelog/fix-launch-button-wpcom
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: restore an early return


0 comments on commit 4da10aa

Please sign in to comment.