Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JITMs: allow shortcircuiting via existing filter #41380

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

JITMs: ensure we offer the same shortcircuit as in other elements where JITMs can be injected.
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
Loading