base-handler.php
2 years ago
get-response-handler.php
2 years ago
mailchimp-handler.php
2 years ago
options-handler.php
2 years ago
tab-handler-manager.php
2 years ago
mailchimp-handler.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Admin\Tabs_Handlers; |
| 5 | |
| 6 | // If this file is called directly, abort. |
| 7 | if ( ! defined( 'WPINC' ) ) { |
| 8 | die; |
| 9 | } |
| 10 | |
| 11 | class Mailchimp_Handler extends Base_Handler { |
| 12 | |
| 13 | public function slug() { |
| 14 | return 'mailchimp-tab'; |
| 15 | } |
| 16 | |
| 17 | public function on_get_request() { |
| 18 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 19 | $api_key = sanitize_text_field( wp_unslash( $_POST['api_key'] ?? '' ) ); |
| 20 | |
| 21 | $result = $this->update_options( |
| 22 | array( |
| 23 | 'api_key' => $api_key, |
| 24 | ) |
| 25 | ); |
| 26 | |
| 27 | $this->send_response( $result ); |
| 28 | } |
| 29 | |
| 30 | public function on_load() { |
| 31 | return $this->get_options( |
| 32 | array( |
| 33 | 'api_key' => '', |
| 34 | ) |
| 35 | ); |
| 36 | } |
| 37 | } |
| 38 |