From 06894169da06d2f0c8464e266674e1d6b7a552f8 Mon Sep 17 00:00:00 2001 From: LuigiPulcini Date: Fri, 5 Nov 2021 00:32:18 +0100 Subject: [PATCH] Added logic to return on custom actions This change adds the possibility for custom actions to return prematurely before the AJAX request is sent. --- .../assets/js/admin/meta-boxes-product-variation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/woocommerce/assets/js/admin/meta-boxes-product-variation.js b/plugins/woocommerce/assets/js/admin/meta-boxes-product-variation.js index 15f32f01350..e5a8b292f71 100644 --- a/plugins/woocommerce/assets/js/admin/meta-boxes-product-variation.js +++ b/plugins/woocommerce/assets/js/admin/meta-boxes-product-variation.js @@ -807,6 +807,10 @@ jQuery( function( $ ) { default : $( 'select.variation_actions' ).trigger( do_variation_action ); data = $( 'select.variation_actions' ).triggerHandler( do_variation_action + '_ajax_data', data ); + + if ( true === data.cancel ) { + return; + } break; }