active-campaign-handler.php
4 years ago
base-handler.php
4 years ago
captcha-handler.php
4 years ago
get-response-handler.php
4 years ago
mailchimp-handler.php
4 years ago
payments-gateways-handler.php
4 years ago
paypal-handler.php
4 years ago
tab-handler-manager.php
4 years ago
get-response-handler.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Admin\Tabs_Handlers; |
| 5 | |
| 6 | |
| 7 | class Get_Response_Handler extends Base_Handler { |
| 8 | |
| 9 | public function slug() { |
| 10 | return 'get-response-tab'; |
| 11 | } |
| 12 | |
| 13 | public function on_get_request() { |
| 14 | $api_key = sanitize_text_field( $_POST['api_key'] ); |
| 15 | |
| 16 | $result = $this->update_options( array( |
| 17 | 'api_key' => $api_key, |
| 18 | ) ); |
| 19 | |
| 20 | $result ? wp_send_json_success( array( |
| 21 | 'message' => __( 'Saved successfully!', 'jet-form-builder' ) |
| 22 | ) ) : wp_send_json_error( array( |
| 23 | 'message' => __( 'Unsuccessful save.', 'jet-form-builder' ) |
| 24 | ) ); |
| 25 | } |
| 26 | |
| 27 | public function on_load() { |
| 28 | return $this->get_options( array( |
| 29 | 'api_key' => '', |
| 30 | ) ); |
| 31 | } |
| 32 | } |