bad-request-event.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Actions\Events\Bad_Request; |
| 5 | |
| 6 | use Jet_Form_Builder\Actions\Events\Base_Event; |
| 7 | |
| 8 | class Bad_Request_Event extends Base_Event { |
| 9 | |
| 10 | public function get_id(): string { |
| 11 | return 'BAD.REQUEST'; |
| 12 | } |
| 13 | |
| 14 | public function get_label(): string { |
| 15 | return __( 'When validation of request is failed', 'jet-form-builder' ); |
| 16 | } |
| 17 | |
| 18 | public function get_help(): string { |
| 19 | return __( |
| 20 | 'is executed after processing the request provided there are errors |
| 21 | in the form fields such as a media field filled out in the wrong format, |
| 22 | exceeded file size limit, etc. The event passes through DEFAULT.PROCESS;', |
| 23 | 'jet-form-builder' |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | public function executors(): array { |
| 28 | return array( |
| 29 | new Bad_Request_Executor(), |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | public function to_array(): array { |
| 34 | return parent::to_array() + array( |
| 35 | 'always' => true, |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | } |
| 40 |