PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / trunk
JetFormBuilder — Dynamic Blocks Form Builder vtrunk
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / blocks-v2 / phone-field / admin-tabs / phone-field-handler.php
jetformbuilder / modules / blocks-v2 / phone-field / admin-tabs Last commit date
phone-field-handler.php 2 months ago
phone-field-handler.php
57 lines
1 <?php
2
3 namespace JFB_Modules\Blocks_V2\Phone_Field\Admin_Tabs;
4
5 use Jet_Form_Builder\Admin\Tabs_Handlers\Base_Handler;
6
7 // If this file is called directly, abort.
8 if ( ! defined( 'WPINC' ) ) {
9 die;
10 }
11
12 /**
13 * Phone Field Settings Handler
14 *
15 * Manages global settings for Phone Field (ipinfo.io API token)
16 */
17 class Phone_Field_Handler extends Base_Handler {
18
19 /**
20 * Default options
21 */
22 const OPTIONS = array(
23 'ipinfo_token' => '',
24 );
25
26 /**
27 * Tab slug
28 */
29 public function slug() {
30 return 'phone-field-tab';
31 }
32
33 /**
34 * Handle POST request to save settings
35 */
36 public function on_get_request() {
37 // phpcs:disable WordPress.Security.NonceVerification.Missing
38 $ipinfo_token = sanitize_text_field( wp_unslash( $_POST['ipinfo_token'] ?? '' ) );
39 // phpcs:enable WordPress.Security.NonceVerification.Missing
40
41 $result = $this->update_options(
42 array(
43 'ipinfo_token' => $ipinfo_token,
44 )
45 );
46
47 $this->send_response( $result );
48 }
49
50 /**
51 * Load options (required by Base_Handler)
52 */
53 public function on_load() {
54 return $this->get_options( self::OPTIONS );
55 }
56 }
57