| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
namespace Jet_Form_Builder\Actions\Events\Default_Required; |
| 5 |
|
| 6 |
use Jet_Form_Builder\Actions\Events\Base_Event; |
| 7 |
|
| 8 |
// If this file is called directly, abort. |
| 9 |
if ( ! defined( 'WPINC' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
class Default_Required_Event extends Base_Event { |
| 14 |
|
| 15 |
public function get_id(): string { |
| 16 |
return 'DEFAULT.REQUIRED'; |
| 17 |
} |
| 18 |
|
| 19 |
public function get_label(): string { |
| 20 |
return __( 'When validation of request is failed', 'jet-form-builder' ); |
| 21 |
} |
| 22 |
|
| 23 |
public function get_help(): string { |
| 24 |
return __( |
| 25 |
'is executed at any time regardless of the form errors |
| 26 |
and unsuccessfully executed actions. The event is performed at the |
| 27 |
very end before the form response is submitted. By default, it is |
| 28 |
used by the Save Form Record action and cannot be added to other events |
| 29 |
through the form editor. |
| 30 |
<br/> |
| 31 |
<i>P.S. In case there are several post-submit actions under one DEFAULT.REQUIRED event, |
| 32 |
then Save Form Record should come last on the list. Otherwise, |
| 33 |
the status for the completed action will be saved incorrectly;</i>', |
| 34 |
'jet-form-builder' |
| 35 |
); |
| 36 |
} |
| 37 |
|
| 38 |
public function executors(): array { |
| 39 |
return array( |
| 40 |
new Default_Required_Executor(), |
| 41 |
); |
| 42 |
} |
| 43 |
|
| 44 |
public function to_array(): array { |
| 45 |
return parent::to_array() + array( |
| 46 |
'always' => true, |
| 47 |
); |
| 48 |
} |
| 49 |
|
| 50 |
} |
| 51 |
|