PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | elementor-elements/classes/wdk-locations-carousel.php +10 -7 1.2.8 → 1.5.9 View file →
@@ -29,8 +29,9 @@
29 29 \Elementor\Controls_Manager::add_tab(
30 30 'tab_conf',
31 31 esc_html__('Settings', 'wpdirectorykit')
32 32 );
33 +
33 34
34 35 \Elementor\Controls_Manager::add_tab(
35 36 'tab_layout',
36 37 esc_html__('Layout', 'wpdirectorykit')
@@ -130,9 +131,9 @@
130 131
131 132 $locations_ids = array();
132 133 foreach($this->data['settings']['conf_custom_results'] as $location) {
133 134 if(isset($location['location_id']) && !empty($location['location_id'])) {
134 - $locations_ids [] = $location['location_id'];
135 + $locations_ids [] = (int)$location['location_id'];
135 136 }
136 137 }
137 138
138 139 /* where in */
@@ -149,15 +150,15 @@
149 150
150 151 } else {
151 152 $order_by = NULL;
152 153 if(!empty($this->data['settings']['conf_order_by']))
153 - $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
154 + $order_by = wdk_esc_sql_order_by($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'], $this->WMVC->{$controller.'_m'}->getAllowedOrderBy());
154 155
155 156 $where = array();
156 157 if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
157 158 $where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
158 159 }
159 - $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination($this->data['settings']['conf_limit'], NULL, $where, $order_by);
160 + $this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination((!empty($this->data['settings']['conf_limit'])) ? $this->data['settings']['conf_limit'] : NULL, NULL, $where, $order_by);
160 161 }
161 162
162 163 $this->data['is_edit_mode']= false;
163 164 if(Plugin::$instance->editor->is_edit_mode())
@@ -162,9 +163,9 @@
162 163 $this->data['is_edit_mode']= false;
163 164 if(Plugin::$instance->editor->is_edit_mode())
164 165 $this->data['is_edit_mode']= true;
165 166
166 - echo $this->view('wdk-locations-carousel', $this->data);
167 + $this->view('wdk-locations-carousel', $this->data, true);
167 168 }
168 169
169 170 private function generate_controls_conf() {
170 171 $this->start_controls_section(
@@ -184,9 +185,9 @@
184 185 $this->add_control(
185 186 'conf_link',
186 187 [
187 188 'label' => __( 'Open results on page', 'wpdirectorykit' ),
188 - 'type' => \Elementor\Controls_Manager::SELECT,
189 + 'type' => \Elementor\Controls_Manager::SELECT2,
189 190 'default' => '',
190 191 'options' => $pages
191 192 ]
192 193 );
@@ -209,8 +210,9 @@
209 210 'important_note',
210 211 [
211 212 'label' => '',
212 213 'type' => \Elementor\Controls_Manager::RAW_HTML,
214 + /* translators: 1: URL. */
213 215 'raw' => wdk_sprintf(__( 'Manage Locations <a href="%1$s" target="_blank"> open </a>', 'wpdirectorykit' ), admin_url('admin.php?page=wdk_location')),
214 216 'content_classes' => 'wdk_elementor_hint',
215 217 ]
216 218 );
@@ -229,11 +231,12 @@
229 231 $this->add_control(
230 232 'conf_limit',
231 233 [
232 234 'label' => __( 'Limit Locations', 'wpdirectorykit' ),
235 + 'description' => __( 'Set 0 for unlimit', 'wpdirectorykit' ),
233 236 'type' => \Elementor\Controls_Manager::NUMBER,
234 - 'min' => 1,
235 - 'max' => 50,
237 + 'min' => 0,
238 + 'max' => 500,
236 239 'step' => 1,
237 240 'default' => 6,
238 241 'conditions' => [
239 242 'terms' => [