Skip to content

Commit

Permalink
JITMs: allow shortcircuiting via existing filter (#41380)
Browse files Browse the repository at this point in the history
We currently offer a filter that can be used to shortcircuit JITMs in other places of the dashboard. It's fair to assume that one using the filter would expect it to apply to all JITMs, including those in the admin menu.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13286597930

Upstream-Ref: Automattic/jetpack@18802df
  • Loading branch information
jeherve authored and matticbot committed Feb 12, 2025
1 parent ae7ab16 commit c9a2288
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 93 deletions.
62 changes: 31 additions & 31 deletions composer.lock

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

8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-masterbar/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.12.3-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Fixed
- JITMs: ensure we offer the same shortcircuit as in other elements where JITMs can be injected.

## [0.12.2] - 2025-02-10
### Changed
- Updated package dependencies. [#41491]
Expand Down Expand Up @@ -223,6 +230,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Notifications: Change Icon [#37676]
- Updated package dependencies. [#37669] [#37706]

[0.12.3-alpha]: https://github.com/Automattic/jetpack-masterbar/compare/v0.12.2...v0.12.3-alpha
[0.12.2]: https://github.com/Automattic/jetpack-masterbar/compare/v0.12.1...v0.12.2
[0.12.1]: https://github.com/Automattic/jetpack-masterbar/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/Automattic/jetpack-masterbar/compare/v0.11.0...v0.12.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,12 @@ public function add_woocommerce_installation_menu( $current_plan = null ) {
public function wp_ajax_upsell_nudge_jitm() {
check_ajax_referer( 'upsell_nudge_jitm' );

// Filter to turn off all just in time messages
/** This action is already documented in \Automattic\Jetpack\JITMS\JITM */
if ( ! apply_filters( 'jetpack_just_in_time_msgs', true ) ) {
wp_die();
}

$nudge = $this->get_upsell_nudge();
if ( ! $nudge ) {
wp_die();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Main {

const PACKAGE_VERSION = '0.12.2';
const PACKAGE_VERSION = '0.12.3-alpha';

/**
* Initializer.
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"automattic/jetpack-calypsoify": "^0.2.2-alpha",
"automattic/jetpack-classic-theme-helper": "^0.10.0",
"automattic/jetpack-connection": "^6.4.1",
"automattic/jetpack-masterbar": "^0.12.2",
"automattic/jetpack-masterbar": "^0.12.3-alpha",
"automattic/jetpack-redirect": "^3.0.1",
"automattic/jetpack-stats-admin": "^0.24.1",
"automattic/jetpack-status": "^5.0.3",
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 @@ -46,7 +46,7 @@
),
'jetpack-masterbar' => array(
'path' => 'jetpack_vendor/automattic/jetpack-masterbar',
'ver' => '0.12.2',
'ver' => '0.12.3-alpha1739367223',
),
'jetpack-mu-wpcom' => array(
'path' => 'jetpack_vendor/automattic/jetpack-mu-wpcom',
Expand Down
Loading

0 comments on commit c9a2288

Please sign in to comment.