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
captcha-handler.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Admin\Tabs_Handlers; |
| 5 | |
| 6 | |
| 7 | class Captcha_Handler extends Base_Handler { |
| 8 | |
| 9 | public function slug() { |
| 10 | return 'captcha-tab'; |
| 11 | } |
| 12 | |
| 13 | public function on_get_request() { |
| 14 | $secret = sanitize_text_field( $_POST['secret'] ); |
| 15 | $key = sanitize_text_field( $_POST['key'] ); |
| 16 | |
| 17 | $result = $this->update_options( array( |
| 18 | 'secret' => $secret, |
| 19 | 'key' => $key |
| 20 | ) ); |
| 21 | |
| 22 | $result ? wp_send_json_success( array( |
| 23 | 'message' => __( 'Saved successfully!', 'jet-form-builder' ) |
| 24 | ) ) : wp_send_json_error( array( |
| 25 | 'message' => __( 'Unsuccessful save.', 'jet-form-builder' ) |
| 26 | ) ); |
| 27 | } |
| 28 | |
| 29 | public function on_load() { |
| 30 | return $this->get_options( array( |
| 31 | 'key' => '', |
| 32 | 'secret' => '' |
| 33 | ) ); |
| 34 | } |
| 35 | } |