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