Skip to content

Commit

Permalink
Remove jetpack recommendation banners from non jetpack pages in wp-ad…
Browse files Browse the repository at this point in the history
…min (#34769)

* Stop showing the recommendations banner on non-jetpack pages in wp-admin

* changelog
  • Loading branch information
jboland88 authored Dec 25, 2023
1 parent 9355163 commit 4359844
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Remove the recommendations banner from non-jetpack wp-admin pages
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* Displays the site type recommendations question as a banner.
* DEPRECATED in v 13.0
*
* @package automattic/jetpack
*/
Expand Down
16 changes: 0 additions & 16 deletions projects/plugins/jetpack/class.jetpack-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,22 +599,6 @@ public function should_display_jitms_on_screen( $value, $screen_id ) {
return false;
}

// Disable all JITMs on pages where the recommendations banner is displaying.
if (
in_array(
$screen_id,
array(
'dashboard',
'plugins',
'jetpack_page_stats',
),
true
)
&& \Jetpack_Recommendations_Banner::can_be_displayed()
) {
return false;
}

return $value;
}
}
Expand Down
4 changes: 0 additions & 4 deletions projects/plugins/jetpack/class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,6 @@ private function __construct() {

add_action( 'wp_ajax_jetpack_connection_banner', array( $this, 'jetpack_connection_banner_callback' ) );

add_action( 'wp_ajax_jetpack_recommendations_banner', array( 'Jetpack_Recommendations_Banner', 'ajax_callback' ) );

add_action( 'wp_loaded', array( $this, 'register_assets' ) );

/**
Expand Down Expand Up @@ -3342,8 +3340,6 @@ public function admin_init() {
Client::_wp_remote_request( self::connection()->api_url( 'test' ), $args, true );
}

Jetpack_Recommendations_Banner::init();

if ( current_user_can( 'manage_options' ) && ! self::permit_ssl() ) {
add_action( 'jetpack_notices', array( $this, 'alert_auto_ssl_fail' ) );
}
Expand Down

0 comments on commit 4359844

Please sign in to comment.