api
1 year ago
assets
1 year ago
rest-api
1 year ago
get-response-action.php
1 year ago
get-response-tab-handler.php
1 year ago
get-response.php
1 year ago
get-response-tab-handler.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Actions_V2\Get_Response; |
| 5 | |
| 6 | use Jet_Form_Builder\Admin\Tabs_Handlers\Base_Handler; |
| 7 | |
| 8 | class Get_Response_Tab_Handler extends Base_Handler { |
| 9 | |
| 10 | public function slug() { |
| 11 | return 'get-response-tab'; |
| 12 | } |
| 13 | |
| 14 | public function on_get_request() { |
| 15 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 16 | $api_key = sanitize_text_field( wp_unslash( $_POST['api_key'] ?? '' ) ); |
| 17 | |
| 18 | $result = $this->update_options( |
| 19 | array( |
| 20 | 'api_key' => $api_key, |
| 21 | ) |
| 22 | ); |
| 23 | |
| 24 | $this->send_response( $result ); |
| 25 | } |
| 26 | |
| 27 | public function on_load() { |
| 28 | return $this->get_options( |
| 29 | array( |
| 30 | 'api_key' => '', |
| 31 | ) |
| 32 | ); |
| 33 | } |
| 34 | } |
| 35 |