PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.14
Shortcodes and extra features for Phlox theme v2.17.14
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / custom-list.php
auxin-elements / includes / elements Last commit date
about-widget.php 1 year ago accordion-widget.php 1 year ago accordion.php 1 year ago attachment-url.php 1 year ago audio.php 1 year ago before-after.php 1 year ago button.php 1 year ago code.php 1 year ago contact-box.php 1 year ago contact-form.php 1 year ago custom-list.php 6 months ago divider.php 1 year ago dropcap.php 1 year ago facebook.php 1 year ago flickr.php 1 year ago gallery.php 1 year ago gmap.php 1 year ago highlight.php 1 year ago image.php 1 year ago instagram-feed.php 1 year ago latest-posts-slider.php 1 year ago popular-posts-widget.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-posts-widget.php 1 year ago recent-products.php 1 year ago related-posts.php 8 years ago sample-element.php 1 year ago search.php 1 year ago socials-list.php 1 year ago staff.php 1 year ago tab-widget.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 1 year ago
custom-list.php
332 lines
1 <?php
2 /**
3 * List element if site origin bundle plugin is activaited
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2025 averta
11 */
12
13 function auxin_get_list_master_array( $master_array ) {
14
15 $master_array['aux_icon_list'] = array(
16 'name' => __('List', 'auxin-elements'),
17 'auxin_output_callback' => 'auxin_widget_list_callback',
18 'base' => 'aux_icon_list',
19 'description' => __('Icon List', 'auxin-elements'),
20 'class' => 'aux-widget-icon-list',
21 'show_settings_on_create' => true,
22 'weight' => 1,
23 'is_widget' => false,
24 'is_shortcode' => true,
25 'category' => THEME_NAME,
26 'group' => '',
27 'admin_enqueue_js' => '',
28 'admin_enqueue_css' => '',
29 'front_enqueue_js' => '',
30 'front_enqueue_css' => '',
31 'icon' => 'aux-element aux-pb-icons-list',
32 'custom_markup' => '',
33 'js_view' => '',
34 'html_template' => '',
35 'deprecated' => '',
36 'content_element' => '',
37 'as_parent' => '',
38 'as_child' => '',
39 'params' => array(
40 array(
41 'heading' => __('Title','auxin-elements'),
42 'description' => __('leave it empty if you don`t need title.', 'auxin-elements'),
43 'param_name' => 'title',
44 'type' => 'textfield',
45 'value' => '',
46 'holder' => 'textfield',
47 'class' => 'title',
48 'admin_label' => false,
49 'dependency' => '',
50 'weight' => '',
51 'group' => '' ,
52 'edit_field_class' => ''
53 ),
54 array(
55 'heading' => __('Text','auxin-elements'),
56 'repeater' => 'list',
57 'repeater-label' => __('List', 'auxin-elements'),
58 'section-name' => __('List Item', 'auxin-elements'),
59 'param_name' => 'text_primary',
60 'type' => 'textfield',
61 'value' => __('List Item', 'auxin-elements' ),
62 'holder' => 'textfield',
63 'class' => 'text_primary',
64 'admin_label' => true,
65 'dependency' => '',
66 'weight' => '',
67 'group' => '' ,
68 'edit_field_class' => ''
69 ),
70 array(
71 'heading' => __('Icon','auxin-elements'),
72 'repeater' => 'list',
73 'repeater-label' => __('List', 'auxin-elements'),
74 'section-name' => __('List Item', 'auxin-elements'),
75 'param_name' => 'icon',
76 'type' => 'aux_iconpicker',
77 'value' => '',
78 'holder' => 'textfield',
79 'class' => 'item_icon',
80 'admin_label' => false,
81 'dependency' => '',
82 'weight' => '',
83 'group' => '' ,
84 'edit_field_class' => ''
85 ),
86 array(
87 'heading' => __('Text Tag','auxin-elements'),
88 'repeater' => 'list',
89 'repeater-label' => __('List', 'auxin-elements'),
90 'section-name' => __('List Item', 'auxin-elements'),
91 'param_name' => 'text_tag',
92 'type' => 'textfield',
93 'value' => __('List Item', 'auxin-elements' ),
94 'holder' => 'textfield',
95 'class' => 'text_tag',
96 'admin_label' => true,
97 'dependency' => '',
98 'weight' => '',
99 'group' => '' ,
100 'edit_field_class' => ''
101 ),
102 array(
103 'heading' => __('Link','auxin-elements'),
104 'repeater' => 'list',
105 'repeater-label' => __('List', 'auxin-elements'),
106 'section-name' => __('List Item', 'auxin-elements'),
107 'param_name' => 'link',
108 'type' => 'textfield',
109 'value' => '',
110 'holder' => 'textfield',
111 'class' => 'link',
112 'admin_label' => false,
113 'dependency' => '',
114 'weight' => '',
115 'group' => '' ,
116 'edit_field_class' => ''
117 ),
118 array(
119 'heading' => __('Text Seconday','auxin-elements'),
120 'repeater' => 'list',
121 'repeater-label' => __('List', 'auxin-elements'),
122 'section-name' => __('List Item', 'auxin-elements'),
123 'param_name' => 'text_secondary',
124 'type' => 'textfield',
125 'value' => '',
126 'holder' => 'textfield',
127 'class' => 'text_secondary',
128 'admin_label' => true,
129 'dependency' => '',
130 'weight' => '',
131 'group' => '' ,
132 'edit_field_class' => ''
133 ),
134 array(
135 'heading' => __('Description','auxin-elements'),
136 'repeater' => 'list',
137 'repeater-label' => __('List', 'auxin-elements'),
138 'section-name' => __('List Item', 'auxin-elements'),
139 'param_name' => 'description',
140 'type' => 'textfield',
141 'value' => '',
142 'holder' => 'textfield',
143 'class' => 'description',
144 'admin_label' => true,
145 'dependency' => '',
146 'weight' => '',
147 'group' => '' ,
148 'edit_field_class' => ''
149 ),
150 array(
151 'heading' => __('Display Connector','auxin-elements' ),
152 'description' => __('Whether to display a line that connects two texts in each list item.', 'auxin-elements'),
153 'param_name' => 'connector',
154 'type' => 'dropdown',
155 'def_value' => 'no',
156 'value' => array(
157 'yes' => __('Yes', 'auxin-elements' ),
158 'no' => __('No' , 'auxin-elements' )
159 ),
160 'holder' => '',
161 'class' => '',
162 'admin_label' => false,
163 'dependency' => '',
164 'weight' => '',
165 'group' => '' ,
166 'edit_field_class' => ''
167 ),
168 array(
169 'heading' => __('Display Divider','auxin-elements' ),
170 'description' => __('Whether to display a divider between list items or not.', 'auxin-elements'),
171 'param_name' => 'divider',
172 'type' => 'dropdown',
173 'def_value' => 'no',
174 'value' => array(
175 'yes' => __('Yes', 'auxin-elements' ),
176 'no' => __('No' , 'auxin-elements' )
177 ),
178 'holder' => '',
179 'class' => '',
180 'admin_label' => false,
181 'dependency' => '',
182 'weight' => '',
183 'group' => '' ,
184 'edit_field_class' => ''
185 ),
186 array(
187 'heading' => __('Extra class name','auxin-elements'),
188 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements'),
189 'param_name' => 'extra_classes',
190 'type' => 'textfield',
191 'value' => '',
192 'def_value' => '',
193 'holder' => 'textfield',
194 'class' => 'extra_classes',
195 'admin_label' => false,
196 'dependency' => '',
197 'weight' => '',
198 'group' => '' ,
199 'edit_field_class' => ''
200 )
201 )
202 );
203
204 return $master_array;
205 }
206
207 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_list_master_array', 10, 1 );
208
209
210 /**
211 * List Element
212 *
213 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
214 * @param string $shortcode_content The shorcode content
215 * @return string The output of element markup
216 */
217 function auxin_widget_list_callback( $atts, $shortcode_content = null ){
218
219 // Defining default attributes
220 $default_atts = array(
221 'title' => '', // header title
222 'list' => '', // repeater items
223 'direction' => 'default',
224 'connector' => 'no',
225 'divider' => 'no',
226 'title_tag' => 'h6',
227 'item_class_prefix' => '', // Default class prefix for each repeater item
228 'extra_classes' => '', // custom css class names for this element
229 'custom_el_id' => '', // custom id attribute for this element
230 'base_class' => 'aux-widget-icon-list' // base class name for container
231 );
232
233 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
234 extract( $result['parsed_atts'] );
235
236 // widget header ------------------------------
237 $output = $result['widget_header'];
238 $output .= $result['widget_title'];
239
240 $output .= '<div class="widget-inner">';
241 $output .= '<div class="aux-widget-icon-list-inner">';
242
243 // Attrs for list wrapper
244 $list_attrs = array(
245 'class' => array( 'aux-icon-list-items', 'aux-direction-' . esc_attr( $direction ) )
246 );
247 if( auxin_is_true( $divider ) ){
248 $list_attrs['class'][] = 'aux-icon-list-divider';
249 }
250 $output .= '<ul '. auxin_make_html_attributes( $list_attrs ) .'>';
251
252
253 // widget custom output -----------------------
254 if ( is_array( $list ) || is_object( $list ) ) {
255 foreach ( $list as $index => $list_item ) {
256
257 // Class for each repeater item
258 $item_classes = array( 'aux-icon-list-item' );
259
260 if( auxin_is_true( $connector ) ){
261 $item_classes[] = 'aux-list-item-has-connector';
262 }
263
264 if( ! empty( $list_item['custom_class_name'] ) ) {
265 $item_classes[] = $list_item['custom_class_name'];
266 }
267
268 if( $item_unique_id = ! empty( $list_item['_id'] ) ? $list_item['_id'] : '' ){
269 $item_classes[] = 'aux-list-item-has-icon';
270 $item_classes[] = 'aux-icon-list-item-'. esc_attr( $item_unique_id );
271 $item_classes[] = 'elementor-repeater-item-'. esc_attr( $item_unique_id );
272 }
273
274 $item_text_tag = ! empty( $list_item['text_tag'] ) && $list_item['text_tag'] != 'script' ? $list_item['text_tag'] : 'span';
275 $output .= '<li '. auxin_make_html_attributes( array( 'class' => $item_classes ) ) .'>';
276
277 // Generate link for list item
278 if( ! empty( $list_item['link']['url'] ) ){
279 $link_attrs = array(
280 'class' => array( 'aux-icon-list-link' ),
281 'href' => esc_url( $list_item['link']['url'] )
282 );
283 if( ! empty( $list_item['link']['is_external'] ) ){
284 $link_attrs['target'] = '_blank';
285 }
286 if( ! empty( $list_item['link']['nofollow'] ) ){
287 $link_attrs['rel'] = 'nofollow';
288 }
289 $output .= '<a '. auxin_make_html_attributes( $link_attrs ) .'>';
290 }
291
292 // a fix to prevent unwanted default value 'check-1' which is set in elementor
293 if( ( ! empty( $list_item['icon'] ) && 'check-1' != $list_item['icon'] ) || is_array( $list_item['icon'] ) ){
294 if ( is_array( $list_item['icon'] ) ) {
295 if ( $list_item['icon']['library'] == 'svg') {
296 $output .= '<div class="aux-icon-list-icon">' . \Elementor\Icons_Manager::render_uploaded_svg_icon( $list_item['icon']['value']) . '</div>';
297 } else {
298 $output .= \Elementor\Icons_Manager::render_font_icon( $list_item['icon'], [ 'aria-hidden' => 'true', 'class' => 'aux-icon-list-icon' ] );
299 }
300 } else {
301 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-icon', esc_attr( $list_item['icon'] ) ) ) ) .'></span>';
302 }
303 }
304 if( ! empty( $list_item['text_primary'] ) ){
305 $output .= "<$item_text_tag ". auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-text' ) ) ) .'>' . auxin_kses( $list_item['text_primary'] ) . "</$item_text_tag>";
306 }
307 if( auxin_is_true( $connector ) ){
308 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-list-connector' ) ) ) .'></span>';
309 }
310 if( ! empty( $list_item['text_secondary'] ) ){
311 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-text2' ) ) ) .'>' . auxin_kses( $list_item['text_secondary'] ) . '</span>';
312 }
313 if( ! empty( $list_item['description'] ) ){
314 $output .= '<p '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-description' ) ) ) .'>' . auxin_kses( $list_item['description'] ) . '</p>';
315 }
316
317 if( ! empty( $list_item['link']['url'] ) ){
318 $output .= '</a>';
319 }
320
321 $output .= '</li>';
322 }
323 }
324
325 $output .= '</ul></div></div>'; // End od widget-toggle
326 $output .= $result['widget_footer'];
327
328 // widget footer ------------------------------
329
330 return wp_kses_post( $output );
331 }
332