Added logic to return on custom actions

This change adds the possibility for custom actions to return prematurely before the AJAX request is sent.
This commit is contained in:
LuigiPulcini 2021-11-05 00:32:18 +01:00 committed by GitHub
parent 77ccfc56ca
commit 06894169da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -807,6 +807,10 @@ jQuery( function( $ ) {
default : default :
$( 'select.variation_actions' ).trigger( do_variation_action ); $( 'select.variation_actions' ).trigger( do_variation_action );
data = $( 'select.variation_actions' ).triggerHandler( do_variation_action + '_ajax_data', data ); data = $( 'select.variation_actions' ).triggerHandler( do_variation_action + '_ajax_data', data );
if ( true === data.cancel ) {
return;
}
break; break;
} }