Closed bytepack closed 1 year ago
It looks like that code uses this:
throw ( new Action_Exception( 'Lucky!' ) )->dynamic_success();
Your suggestion is in a comment, but its from a file thats 2 years old.
I had a very brief look and it seems that what the code does is prefix it with dsuccess
(dynamic success), so this MIGHT work:
throw new Action_Exception( 'dsuccess' )
But I wouldn't really want to start using internal codes when there is a method already available.
Currently (on 3.1.8 version), with this code, $is_success
returns true.
add_action(
'jet-form-builder/custom-action/test-success',
function () {
throw new \Jet_Form_Builder\Exceptions\Action_Exception( 'success' );
}
);
add_action(
'jet-form-builder/form-handler/after-send',
function ( $handler, $is_success ) {
var_dump( $is_success ); die;
},
10,
2
);
Hi If we use Call Hook action and
throw new Action_Exception( 'success' ) )
, when we usejet-form-builder/form-handler/after-send
hook, the$is_success
isfalse
in thefunction( $handler, bool $is_success )
.According to this code,
throw new Action_Exception( 'success' ) )
has success result.