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 -15 2.2.12.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,15 +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 - } elseif ( 'repeaters' === $field['type'] && ! empty( $the_value ) ) {
51 - $the_value = json_decode( $the_value );
52 - }
53 - $sanitized_value = Fns::stripslashes_value( $the_value );
46 + $sanitized_value = Fns::stripslashes_value( $the_value );
54 47 $item['fields'][ $field_key ]['value'] = $sanitized_value;
55 48 }
56 49 }
57 50 $this->full_list[ $name ] = $item;
@@ -80,14 +73,14 @@
80 73 return isset( $this->active_list[ $key ] );
81 74 }
82 75
83 76 /**
84 - * @param mixed $list true | anything
77 + * @param mixed $list true | anything
85 78 * @param string $filter_type full|active|inactive
86 79 *
87 80 * @return mixed
88 81 */
89 - public function get_list( $list = true, $filter_type = 'full' ) {
82 + public function get_list( $list = true, $filter_type = 'full' ) { //
90 83 if ( $list !== true && isset( $this->full_list[ $list ] ) ) {
91 84 return $this->full_list[ $list ];
92 85 }
93 86
@@ -118,5 +111,5 @@
118 111 return $this->db_options;
119 112 }
120 113
121 114 abstract protected function raw_list();
122 -}
115 +}