PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.1.3
ShopBuilder – WooCommerce Builder For Elementor v2.1.3
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Models/Base/ListModel.php +8 -13 2.1.112.1.3 View file →
@@ -13,18 +13,17 @@
13 13
14 14 protected $title;
15 15 protected $short_title;
16 16 protected $description;
17 - private $full_list = [];
18 - private $active_list = [];
17 + private $full_list = [];
18 + private $active_list = [];
19 19 private $inactive_list = [];
20 - private $db_options = [];
21 - protected $categories = [];
20 + private $db_options = [];
21 + protected $categories = [];
22 22
23 23 public function __construct() {
24 24 $this->db_options = DataModel::source()->get_option( $this->list_id, [] );
25 25 $raw_list = apply_filters( 'rtsb/' . $this->list_id . '/list', $this->raw_list() );
26 -
27 26 if ( ! empty( $raw_list ) ) {
28 27 foreach ( $raw_list as $name => $item ) {
29 28
30 29 if ( ! empty( $item['package'] ) && $item['package'] === 'pro-disabled' ) {
@@ -43,13 +42,9 @@
43 42
44 43 if ( ! empty( $item['fields'] ) ) {
45 44 foreach ( $item['fields'] as $field_key => $field ) {
46 45 $the_value = $this->db_options[ $name ][ $field_key ] ?? ( $item['fields'][ $field_key ]['value'] ?? '' );
47 - if ( 'repeaters' === $field['type'] && empty( $the_value ) && ! empty( $field['defaults'] ) ) {
48 - $repeater_defaults = array_values( $field['defaults'] );
49 - $the_value = wp_json_encode( $repeater_defaults );
50 - }
51 - $sanitized_value = Fns::stripslashes_value( $the_value );
46 + $sanitized_value = Fns::stripslashes_value( $the_value );
52 47 $item['fields'][ $field_key ]['value'] = $sanitized_value;
53 48 }
54 49 }
55 50 $this->full_list[ $name ] = $item;
@@ -78,14 +73,14 @@
78 73 return isset( $this->active_list[ $key ] );
79 74 }
80 75
81 76 /**
82 - * @param mixed $list true | anything
77 + * @param mixed $list true | anything
83 78 * @param string $filter_type full|active|inactive
84 79 *
85 80 * @return mixed
86 81 */
87 - public function get_list( $list = true, $filter_type = 'full' ) {
82 + public function get_list( $list = true, $filter_type = 'full' ) { //
88 83 if ( $list !== true && isset( $this->full_list[ $list ] ) ) {
89 84 return $this->full_list[ $list ];
90 85 }
91 86
@@ -116,5 +111,5 @@
116 111 return $this->db_options;
117 112 }
118 113
119 114 abstract protected function raw_list();
120 -}
115 +}