Skip to content

Commit

Permalink
JITM: Remove JITM from Jetpack Stats dashboard (Preparation to use em…
Browse files Browse the repository at this point in the history
…bedded JITM) (#39714)

* expose functiont to render JITM and jitm env for stats

* changelog

* fix typo

* rever formatting

* pass jitm pass to stats admin

* ver and minify

* ver and minify

* ensure it has an option to return early

* revert unnecessary chagnes

* use cache buster as jitm version

* add comments

* revert changes

* revert changes

* Delete projects/packages/jitm/changelog/update-integration-jitm-in-stats
  • Loading branch information
kangzj authored Oct 15, 2024
1 parent 9fac3d5 commit cd86cc6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

JITM: expose function to render message
13 changes: 13 additions & 0 deletions projects/packages/stats-admin/src/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ public static function init() {
*/
private function __construct() {
add_action( 'rest_api_init', array( new REST_Controller(), 'register_rest_routes' ) );
// Disable JITM assets on the Stats page.
// JITM is handled separately by Stats: https://github.com/Automattic/wp-calypso/pull/95273.
add_filter(
'jetpack_display_jitms_on_screen',
function ( $show, $screen_id ) {
if ( 'jetpack_page_stats' === $screen_id ) {
return false;
}
return $show;
},
10,
2
);
}

/**
Expand Down

0 comments on commit cd86cc6

Please sign in to comment.