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 / option-query / traits / option-query-trait.php
jetformbuilder / modules / option-query / traits Last commit date
option-query-trait.php 2 years ago
option-query-trait.php
88 lines
1 <?php
2
3
4 namespace JFB_Modules\Option_Query\Traits;
5
6 // If this file is called directly, abort.
7 if ( ! defined( 'WPINC' ) ) {
8 die;
9 }
10
11 trait Option_Query_Trait {
12
13 /**
14 * Settings which used to display fetched things
15 *
16 * @var array
17 */
18 protected $settings = array();
19
20 /**
21 * Settings which used to query things
22 *
23 * @var array
24 */
25 protected $query = array();
26
27 protected $features = array(
28 'search' => true,
29 );
30
31 public function set_setting( string $name, $value ) {
32 $this->settings[ $name ] = $value;
33 }
34
35 public function get_setting( string $name ) {
36 return $this->settings[ $name ] ?? false;
37 }
38
39 public function has_setting( string $name ): bool {
40 return array_key_exists( $name, $this->settings );
41 }
42
43 public function set_settings( array $settings ) {
44 $this->settings = $settings;
45 }
46
47 public function get_settings(): array {
48 return $this->settings;
49 }
50
51 public function set_query( string $name, $value ) {
52 $this->query[ $name ] = $value;
53 }
54
55 public function get_query( string $name ) {
56 return $this->query[ $name ] ?? false;
57 }
58
59 public function has_query( string $name ): bool {
60 return array_key_exists( $name, $this->query );
61 }
62
63 public function delete_query( string $name ) {
64 unset( $this->query[ $name ] );
65 }
66
67 public function set_query_params( array $params ) {
68 $this->query = $params;
69 }
70
71 public function get_query_params(): array {
72 return $this->query;
73 }
74
75 public function is_support_feature( string $feature_name ): bool {
76 return (bool) ( $this->features[ $feature_name ] ?? false );
77 }
78
79 public function disable_feature( string $feature_name ) {
80 unset( $this->features[ $feature_name ] );
81 }
82
83 public function enable_feature( string $feature_name ) {
84 $this->features[ $feature_name ] = true;
85 }
86
87 }
88