PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.9.22
Shortcodes and extra features for Phlox theme v2.9.22
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 / instagram-feed.php
auxin-elements / includes / elements Last commit date
about-widget.php 4 years ago accordion-widget.php 4 years ago accordion.php 4 years ago attachment-url.php 4 years ago audio.php 4 years ago before-after.php 4 years ago button.php 4 years ago code.php 4 years ago contact-box.php 4 years ago contact-form.php 4 years ago custom-list.php 4 years ago divider.php 4 years ago dropcap.php 4 years ago facebook.php 4 years ago flickr.php 4 years ago gallery.php 4 years ago general-element-fields.php 4 years ago gmap.php 4 years ago highlight.php 4 years ago image.php 4 years ago instagram-feed.php 4 years ago latest-items.php 4 years ago latest-posts-slider.php 4 years ago popular-posts-widget.php 4 years ago products-grid.php 4 years ago quote.php 4 years ago recent-posts-grid-carousel.php 3 years ago recent-posts-land-style.php 4 years ago recent-posts-masonry.php 4 years ago recent-posts-tiles-carousel.php 3 years ago recent-posts-tiles.php 4 years ago recent-posts-timeline.php 4 years ago recent-posts-widget.php 4 years ago recent-products.php 3 years ago related-posts.php 8 years ago sample-element.php 4 years ago search.php 4 years ago socials-list.php 4 years ago staff.php 4 years ago tab-widget.php 4 years ago tabs.php 4 years ago testimonial.php 4 years ago text.php 3 years ago touch-slider.php 4 years ago video.php 4 years ago
instagram-feed.php
393 lines
1 <?php
2 /**
3 * Instagram feed
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2022 averta
11 */
12 function auxin_get_instagram_master_array( $master_array ) {
13
14 $master_array['aux_instagram_feed'] = array( // shortcode info here
15 'name' => __("instagram feed", 'auxin-elements' ),
16 'auxin_output_callback' => 'auxin_widget_instagram_feed_callback',
17 'base' => 'aux_instagram_feed',
18 'description' => __('It adds an instagram feed element.', 'auxin-elements' ),
19 'class' => 'aux-widget-instagram',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'is_widget' => true,
23 'is_shortcode' => true,
24 'is_vc' => 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-image',
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' => __('A title for instagram element', 'auxin-elements' ),
43 'param_name' => 'title',
44 'type' => 'textfield',
45 'value' => '',
46 'holder' => 'textfield',
47 'class' => 'title',
48 'admin_label' => true,
49 'dependency' => '',
50 'weight' => '',
51 'group' => '' ,
52 'edit_field_class' => ''
53 ),
54 array(
55 'heading' => __('Instagram user ID','auxin-elements' ),
56 'description' => sprintf(
57 __('Instagram User ID. Separate multiple IDs by commas. You can find the User ID with %sthis tool%s.', 'auxin-elements' ),
58 '<a href="https://smashballoon.com/instagram-feed/find-instagram-user-id/" target="_blank">',
59 '</a>'
60 ),
61 'param_name' => 'id',
62 'type' => 'textfield',
63 'value' => '',
64 'def_value' => '',
65 'holder' => 'textfield',
66 'class' => 'user_id',
67 'admin_label' => true,
68 'dependency' => '',
69 'weight' => '',
70 'group' => '' ,
71 'edit_field_class' => ''
72 ),
73 array(
74 'heading' => __('Number of photo','auxin-elements' ),
75 'description' => __('Number of photos to display initially. Maximum is 33.','auxin-elements' ),
76 'param_name' => 'num',
77 'type' => 'textfield',
78 'value' => '',
79 'def_value' => '',
80 'holder' => 'textfield',
81 'class' => 'num',
82 'admin_label' => true,
83 'dependency' => '',
84 'weight' => '',
85 'group' => '' ,
86 'edit_field_class' => ''
87 ),
88 array(
89 'heading' => __('Resolution/size of the photos. ','auxin-elements' ),
90 'description' => '',
91 'param_name' => 'imageres',
92 'type' => 'dropdown',
93 'def_value' => 'medium',
94 'value' => array(
95 'auto' => __('Auto', 'auxin-elements' ),
96 'thumb' => __('Thumb', 'auxin-elements' ),
97 'medium' => __('Medium', 'auxin-elements' ),
98 'full' => __('Full', 'auxin-elements' )
99 ),
100 'holder' => '',
101 'class' => 'border',
102 'admin_label' => true,
103 'dependency' => '',
104 'weight' => '',
105 'group' => '' ,
106 'edit_field_class' => ''
107 ),
108 array(
109 'heading' => __('Columns','auxin-elements' ),
110 'description' => __('Number of columns in the feed. 1 - 10.','auxin-elements' ),
111 'param_name' => 'cols',
112 'type' => 'textfield',
113 'value' => '',
114 'def_value' => '',
115 'holder' => 'textfield',
116 'class' => 'columns',
117 'admin_label' => true,
118 'dependency' => '',
119 'weight' => '',
120 'group' => '' ,
121 'edit_field_class' => ''
122 ),
123 array(
124 'heading' => __('Spacing around the photos','auxin-elements' ),
125 'description' => '',
126 'param_name' => 'imagepadding',
127 'type' => 'textfield',
128 'value' => '0',
129 'def_value' => '0',
130 'holder' => 'textfield',
131 'class' => 'height',
132 'admin_label' => true,
133 'dependency' => '',
134 'weight' => '',
135 'group' => '' ,
136 'edit_field_class' => ''
137 ),
138 array(
139 'heading' => __('Unit of the spacing.','auxin-elements' ),
140 'description' => '',
141 'param_name' => 'imagepaddingunit',
142 'type' => 'dropdown',
143 'def_value' => 'px',
144 'value' => array(
145 '%' => __('Percentage (%)', 'auxin-elements' ),
146 'px' => __('Pixels (px)', 'auxin-elements' ),
147 ),
148 'holder' => '',
149 'class' => 'border',
150 'admin_label' => true,
151 'dependency' => '',
152 'weight' => '',
153 'group' => '' ,
154 'edit_field_class' => ''
155 ),
156 // array(
157 // 'param_name' => 'width',
158 // 'type' => 'textfield',
159 // 'value' => '100',
160 // 'def_value' => '100',
161 // 'holder' => 'textfield',
162 // 'class' => 'width',
163 // 'heading' => __('width','auxin-elements' ),
164 // 'description' => '',
165 // 'admin_label' => true,
166 // 'dependency' => '',
167 // 'weight' => '',
168 // 'group' => '' ,
169 // 'edit_field_class' => ''
170 // ),
171 // array(
172 // 'param_name' => 'widthunit',
173 // 'type' => 'dropdown',
174 // 'def_value' => '%',
175 // 'value' => array(
176 // '%' => __('Percentage (%)', 'auxin-elements' ),
177 // 'px' => __('Pixels (px)', 'auxin-elements' ),
178 // ),
179 // 'holder' => '',
180 // 'class' => 'border',
181 // 'heading' => __(' The unit of the width.','auxin-elements' ),
182 // 'description' => '',
183 // 'admin_label' => true,
184 // 'dependency' => '',
185 // 'weight' => '',
186 // 'group' => '' ,
187 // 'edit_field_class' => ''
188 // ),
189 array(
190 'heading' => __('Height','auxin-elements' ),
191 'description' => __('The height of the feed','auxin-elements' ),
192 'param_name' => 'height',
193 'type' => 'textfield',
194 'value' => '',
195 'def_value' => '',
196 'holder' => 'textfield',
197 'class' => 'height',
198 'admin_label' => true,
199 'dependency' => '',
200 'weight' => '',
201 'group' => '' ,
202 'edit_field_class' => ''
203 ),
204 array(
205 'heading' => __('Unit of the height.','auxin-elements' ),
206 'description' => '',
207 'param_name' => 'heightunit',
208 'type' => 'dropdown',
209 'def_value' => 'px',
210 'value' => array(
211 '%' => __('Percentage (%)', 'auxin-elements' ),
212 'px' => __('Pixels (px)', 'auxin-elements' ),
213 ),
214 'holder' => '',
215 'class' => 'border',
216 'admin_label' => true,
217 'dependency' => '',
218 'weight' => '',
219 'group' => '' ,
220 'edit_field_class' => ''
221 ),
222 array(
223 'heading' => __('Background color','auxin-elements' ),
224 'description' => '',
225 'param_name' => 'background',
226 'type' => 'color',
227 'value' => '',
228 'def_value' => '',
229 'holder' => 'textfield',
230 'class' => 'background-color',
231 'admin_label' => true,
232 'dependency' => '',
233 'weight' => '',
234 'group' => '' ,
235 'edit_field_class' => ''
236 ),
237 array(
238 'heading' => __('Show header','auxin-elements' ),
239 'description' => __('Whether to show the feed header.', 'auxin-elements' ),
240 'param_name' => 'showheader',
241 'type' => 'aux_switch',
242 'def_value' => '',
243 'value' => '0',
244 'holder' => '',
245 'class' => 'showheader',
246 'admin_label' => true,
247 'dependency' => '',
248 'weight' => '',
249 'group' => '' ,
250 'edit_field_class' => ''
251 ),
252 array(
253 'heading' => __('Show follow button','auxin-elements' ),
254 'description' => __('Whether to show the Follow on Instagram button.', 'auxin-elements' ),
255 'param_name' => 'showfollow',
256 'type' => 'aux_switch',
257 'def_value' => '',
258 'value' => '0',
259 'holder' => '',
260 'class' => 'showfollow',
261 'admin_label' => true,
262 'dependency' => '',
263 'weight' => '',
264 'group' => '' ,
265 'edit_field_class' => ''
266 ),
267 array(
268 'heading' => __('Show load more button','auxin-elements' ),
269 'description' => __(' Whether to show the load more button.', 'auxin-elements' ),
270 'param_name' => 'showbutton',
271 'type' => 'aux_switch',
272 'def_value' => '',
273 'value' => '0',
274 'holder' => '',
275 'class' => 'showbutton',
276 'admin_label' => true,
277 'dependency' => '',
278 'weight' => '',
279 'group' => '' ,
280 'edit_field_class' => ''
281 ),
282 array(
283 'heading' => __('Extra class name','auxin-elements' ),
284 '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' ),
285 'param_name' => 'extra_classes',
286 'type' => 'textfield',
287 'value' => '',
288 'def_value' => '',
289 'holder' => 'textfield',
290 'class' => 'extra_classes',
291 'admin_label' => true,
292 'dependency' => '',
293 'weight' => '',
294 'group' => '' ,
295 'edit_field_class' => ''
296 )
297 )
298 );
299
300 return $master_array;
301 }
302
303 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_instagram_master_array', 10, 1 );
304
305 // This is the widget call back in fact the front end out put of this widget comes from this function
306 function auxin_widget_instagram_feed_callback( $atts, $shortcode_content = null ) {
307
308 $default_atts = array(
309 'title' => '',
310 'id' => '',
311 'width' => '100',
312 'widthunit' => '%',
313 'height' => '',
314 'heightunit' => 'px',
315 'background' => '',
316 'imagepadding' => '0',
317 'imagepaddingunit' => 'px',
318 'cols' => '',
319 'num' => '',
320 'showheader' => '0',
321 'imageres' => 'medium',
322 'showfollow' => '0',
323 'showbutton' => '0',
324
325 'extra_classes' => '', // custom css class names for this element
326 'custom_el_id' => '', // custom id attribute for this element
327 'base_class' => 'aux-widget-instagram' // base class name for container
328 );
329
330 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
331 extract( $result['parsed_atts'] );
332
333 ob_start();
334
335 // widget header ------------------------------
336 echo wp_kses_post( $result['widget_header'] );
337 echo wp_kses_post( $result['widget_title'] );
338
339
340 // widget custom output -----------------------
341 if( ! empty( $id ) ) {
342 $id =" id=$id";
343 }
344
345 // if( ! empty( $width ) ) {
346 // $width =" width=$width";
347 // }
348
349 if( ! empty( $height ) ) {
350 $height =" height=$height";
351 }
352
353 if( ! empty( $background ) ) {
354 $background =" background=\"$background\"";
355 }
356
357 if( ! empty( $cols ) ) {
358 $cols =" cols=$cols";
359 }
360
361 if( ! empty( $num ) ) {
362 $num =" num=$num";
363 }
364
365 if( ! empty( $extra_classes ) ) {
366 $extra_classes =" class=\"$extra_classes\"";
367 }
368
369 $instagram_feed_shortcode = "[instagram-feed width=100 widthunit=\"%\"".
370 $id.
371 " showbutton=$showbutton".
372 " showfollow=$showfollow".
373 " showheader=$showheader".
374 " imageres=\"$imageres\"".
375 // $width.
376 //" widthunit=\"$widthunit\"".
377 $height.
378 " heightunit=\"$heightunit\"".
379 " imagepaddingunit=\"$imagepaddingunit\"".
380 " imagepadding=$imagepadding".
381 $background.
382 $cols.
383 $num.
384 $extra_classes.
385 "]";
386
387 echo do_shortcode( $instagram_feed_shortcode );
388 // widget footer ------------------------------
389 echo wp_kses_post( $result['widget_footer'] );
390
391 return ob_get_clean();
392 }
393