PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.13
Shortcodes and extra features for Phlox theme v2.5.13
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 / latest-items.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
latest-items.php
501 lines
1 <?php
2 /**
3 * This is a sample of how to create a new element on widgets and visual composer element
4 * Auxin callout widget you can set all the options of this widget here like widget definitation,
5 * its element on siteorigin page builder, visual composer and under appearance/ widgets
6 */
7 function get_auxin_latest_items_vc( $master_array ) {
8
9 $auxin_latest_items_vc = array( // shortcode info here
10 'name' => __("Auxin latest_items", 'auxin-elements' ), // [str] name of your shortcode for human reading inside element list
11 'auxin_output_callback' => 'auxin_widget_latest_items', // [str] NAme of widget function callback which define below this array
12 'base' => 'auxin_latest_items', // [str] shortcode tag. For [my_shortcode] shortcode base is my_shortcode
13 'description' => __('This is will add latest_items element', 'auxin-elements'), // [str] short description of your element, it will be visible in "Add element" window
14 'class' => 'auxin-latest_items', // [str] CSS class which will be added to the shortcode's content element in the page edit screen in Visual Composer backend edit mode. adds 3 classes like testt_o testt_v and testt
15 'show_settings_on_create' => true, // [Boolean] set it to false if content element's settings page shouldn't open automatically after adding it to the stage
16 'weight' => 1, // [Int] content elements with greater weight will be rendered first in "Content Elements" grid, higher appear upper
17 'category' => THEME_NAME, // [str] category which best suites to describe functionality of this shortcode.
18 'group' => '', // [str] TODO: no idea Group your params in groups, they will be divided in tabs in the edit element window
19 'admin_enqueue_js' => '', // [str/arr] this js will be loaded in the js_composer edit mode
20 'admin_enqueue_css' => '', // [str/arr] absolute url to css file
21 'front_enqueue_js' => '', // [str/arr] to load custom js file in the frontend editing mode
22 'front_enqueue_css' => '', // [str/arr] to load custom css file in the frontend editing mode
23 'icon' => '', // URL or CSS class with icon image
24 'custom_markup' => '', // [str] custom html markup for representing shortcode in visual composer editor. This will replace visual composer element where shows the param and its value
25 'js_view' => '', // TODO: no idea Set custom backbone.js view controller for this content element there is a sample wich sets it to
26 'html_template' => '', // it uses to oerride the output of shortcode. Path to shortcode template. This is useful if you want to reassign path of existing content elements lets say override the seprator defined by visual composer.
27 'deprecated' => '', // enter version number of visual composer from which content element will be deprecated
28 'content_element' => '', // If set to false, content element will be hidden from "Add element" window. It is handy to use this param in pair with 'deprecated' param
29 'as_parent' => '', // use only|except attributes to limit child shortcodes (separate multiple values with comma)
30 'as_child' => '', // use only|except attributes to limit parent (separate multiple values with comma)
31 'params' => array(
32 array( // array of parameter
33 'param_name' => 'col', // [str] must be the same as your parameter name
34 'type' => 'textfield', // [str] attribute type
35 'value' => '33', // [str/arr] default attribute's value
36 'def_value' => '33', // [str/arr] default attribute's value
37 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
38 'class' => 'col', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
39 'heading' => __('col','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
40 'description' => __('If you choose Callout a big box appears around the content','auxin-elements'),
41 'admin_label' => true, // [bool] show value of param in Visual Composer editor
42 'dependency' => '', // [arr] define param visibility depending on other field value
43 'weight' => '', // [int] params with greater weight will be rendered first
44 'group' => '' , // [str] use it to divide your params within groups (tabs)
45 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
46 ),
47 array( // array of parameter
48 'param_name' => 'mode', // [str] must be the same as your parameter name
49 'type' => 'dropdown', // [str] attribute type
50 'def_value' => 'no', // [str/arr] default attribute's value
51 'value' => array( 'none' => __('none', 'auxin-elements'), 'caption-over' => __('caption-over', 'auxin-elements') ),
52 'holder' => '', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
53 'class' => 'mode', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
54 'heading' => __('mode type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
55 'description' => __('The round is used got button','auxin-elements'),
56 'admin_label' => true, // [bool] show value of param in Visual Composer editor
57 'dependency' => '', // [arr] define param visibility depending on other field value
58 'weight' => '', // [int] params with greater weight will be rendered first
59 'group' => '' , // [str] use it to divide your params within groups (tabs)
60 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
61 ),
62 array( // array of parameter
63 'param_name' => 'grid', // [str] must be the same as your parameter name
64 'type' => 'textfield', // [str] attribute type
65 'value' => '', // [str/arr] default attribute's value
66 'def_value' => '', // [str/arr] default attribute's value
67 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
68 'class' => 'grid', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
69 'heading' => __('grid','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
70 'description' => __('attachment grid', 'auxin-elements'),
71 'admin_label' => true, // [bool] show value of param in Visual Composer editor
72 'dependency' => '', // [arr] define param visibility depending on other field value
73 'weight' => '', // [int] params with greater weight will be rendered first
74 'group' => '' , // [str] use it to divide your params within groups (tabs)
75 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
76 ),
77 array( // array of parameter
78 'param_name' => 'num', // [str] must be the same as your parameter name
79 'type' => 'textfield', // [str] attribute type
80 'value' => '', // [str/arr] default attribute's value
81 'def_value' => '', // [str/arr] default attribute's value
82 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
83 'class' => 'num', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
84 'heading' => __('num','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
85 'description' => __('attachment num', 'auxin-elements'),
86 'admin_label' => true, // [bool] show value of param in Visual Composer editor
87 'dependency' => '', // [arr] define param visibility depending on other field value
88 'weight' => '', // [int] params with greater weight will be rendered first
89 'group' => '' , // [str] use it to divide your params within groups (tabs)
90 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
91 ),
92 array( // array of parameter
93 'param_name' => 'nav', // [str] must be the same as your parameter name
94 'type' => 'dropdown', // [str] attribute type
95 'def_value' => 'pagination', // [str/arr] default attribute's value
96 'value' => array( 'pagination' => __('pagination', 'auxin-elements'), 'regular' => __('regular', 'auxin-elements') ),
97 'holder' => '', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
98 'class' => 'nav', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
99 'heading' => __('nav type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
100 'description' => __('The round is used got button','auxin-elements'),
101 'admin_label' => true, // [bool] show value of param in Visual Composer editor
102 'dependency' => '', // [arr] define param visibility depending on other field value
103 'weight' => '', // [int] params with greater weight will be rendered first
104 'group' => '' , // [str] use it to divide your params within groups (tabs)
105 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
106 ),
107 array( // array of parameter
108 'param_name' => 'title', // [str] must be the same as your parameter name
109 'type' => 'textfield', // [str] attribute type
110 'value' => '', // [str/arr] default attribute's value
111 'def_value' => '', // [str/arr] default attribute's value
112 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
113 'class' => 'title', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
114 'heading' => __('title','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
115 'description' => __('attachment link', 'auxin-elements'),
116 'admin_label' => true, // [bool] show value of param in Visual Composer editor
117 'dependency' => '', // [arr] define param visibility depending on other field value
118 'weight' => '', // [int] params with greater weight will be rendered first
119 'group' => '' , // [str] use it to divide your params within groups (tabs)
120 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
121 ),
122 array( // array of parameter
123 'param_name' => 'posttype', // [str] must be the same as your parameter name
124 'type' => 'dropdown', // [str] attribute type
125 'def_value' => 'pagination', // [str/arr] default attribute's value
126 'value' => array( 'post' => __('post', 'auxin-elements'), 'regular' => __('regular', 'auxin-elements') ),
127 'holder' => '', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
128 'class' => 'posttype', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
129 'heading' => __('posttype type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
130 'description' => __('The round is used got button','auxin-elements'),
131 'admin_label' => true, // [bool] show value of param in Visual Composer editor
132 'dependency' => '', // [arr] define param visibility depending on other field value
133 'weight' => '', // [int] params with greater weight will be rendered first
134 'group' => '' , // [str] use it to divide your params within groups (tabs)
135 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
136 ),
137 array( // array of parameter
138 'param_name' => 'cat_id', // [str] must be the same as your parameter name
139 'type' => 'textfield', // [str] attribute type
140 'value' => '', // [str/arr] default attribute's value
141 'def_value' => '', // [str/arr] default attribute's value
142 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
143 'class' => 'cat_id', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
144 'heading' => __('cat_id','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
145 'description' => __('attachment alt', 'auxin-elements'),
146 'admin_label' => true, // [bool] show value of param in Visual Composer editor
147 'dependency' => '', // [arr] define param visibility depending on other field value
148 'weight' => '', // [int] params with greater weight will be rendered first
149 'group' => '' , // [str] use it to divide your params within groups (tabs)
150 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
151 ),
152 array( // array of parameter
153 'param_name' => 'taxonomy', // [str] must be the same as your parameter name
154 'type' => 'textfield', // [str] attribute type
155 'value' => 'category', // [str/arr] default attribute's value
156 'def_value' => 'category', // [str/arr] default attribute's value
157 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
158 'class' => 'taxonomy', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
159 'heading' => __('width','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
160 'description' => __('attachment width', 'auxin-elements'),
161 'admin_label' => true, // [bool] show value of param in Visual Composer editor
162 'dependency' => '', // [arr] define param visibility depending on other field value
163 'weight' => '', // [int] params with greater weight will be rendered first
164 'group' => '' , // [str] use it to divide your params within groups (tabs)
165 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
166 ),
167 array( // array of parameter
168 'param_name' => 'view_excerpt', // [str] must be the same as your parameter name
169 'type' => 'dropdown', // [str] attribute type
170 'def_value' => 'no', // [str/arr] default attribute's value
171 'value' => array( 'yes' => __('Yes', 'auxin-elements'), 'no' => __('No', 'auxin-elements') ),
172 'holder' => '', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
173 'class' => 'view_excerpt', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
174 'heading' => __('view_excerpt ?','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
175 'description' => __('The round is used got button','auxin-elements'),
176 'admin_label' => true, // [bool] show value of param in Visual Composer editor
177 'dependency' => '', // [arr] define param visibility depending on other field value
178 'weight' => '', // [int] params with greater weight will be rendered first
179 'group' => '' , // [str] use it to divide your params within groups (tabs)
180 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
181 ),
182 array( // array of parameter
183 'param_name' => 'view_title', // [str] must be the same as your parameter name
184 'type' => 'dropdown', // [str] attribute type
185 'def_value' => 'no', // [str/arr] default attribute's value
186 'value' => array( 'yes' => __('Yes', 'auxin-elements'), 'no' => __('No', 'auxin-elements') ),
187 'holder' => '', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
188 'class' => 'view_title', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
189 'heading' => __('view_title ?','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
190 'description' => __('The round is used got button','auxin-elements'),
191 'admin_label' => true, // [bool] show value of param in Visual Composer editor
192 'dependency' => '', // [arr] define param visibility depending on other field value
193 'weight' => '', // [int] params with greater weight will be rendered first
194 'group' => '' , // [str] use it to divide your params within groups (tabs)
195 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
196 ),
197 array( // array of parameter
198 'param_name' => 'excerpt_len', // [str] must be the same as your parameter name
199 'type' => 'textfield', // [str] attribute type
200 'value' => '100', // [str/arr] default attribute's value
201 'def_value' => '100', // [str/arr] default attribute's value
202 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
203 'class' => 'excerpt_len', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
204 'heading' => __('excerpt_len','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
205 'description' => __('attachment width', 'auxin-elements'),
206 'admin_label' => true, // [bool] show value of param in Visual Composer editor
207 'dependency' => '', // [arr] define param visibility depending on other field value
208 'weight' => '', // [int] params with greater weight will be rendered first
209 'group' => '' , // [str] use it to divide your params within groups (tabs)
210 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
211 ),
212 array( // array of parameter
213 'param_name' => 'section_index', // [str] must be the same as your parameter name
214 'type' => 'textfield', // [str] attribute type
215 'value' => 'category', // [str/arr] default attribute's value
216 'def_value' => 'category', // [str/arr] default attribute's value
217 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
218 'class' => 'section_index', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
219 'heading' => __('section_index','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
220 'description' => __('attachment section_index', 'auxin-elements'),
221 'admin_label' => true, // [bool] show value of param in Visual Composer editor
222 'dependency' => '', // [arr] define param visibility depending on other field value
223 'weight' => '', // [int] params with greater weight will be rendered first
224 'group' => '' , // [str] use it to divide your params within groups (tabs)
225 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
226 ),
227 array( // array of parameter
228 'param_name' => 'paged', // [str] must be the same as your parameter name
229 'type' => 'textfield', // [str] attribute type
230 'value' => 'category', // [str/arr] default attribute's value
231 'def_value' => 'category', // [str/arr] default attribute's value
232 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
233 'class' => 'paged', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
234 'heading' => __('paged','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
235 'description' => __('attachment paged', 'auxin-elements'),
236 'admin_label' => true, // [bool] show value of param in Visual Composer editor
237 'dependency' => '', // [arr] define param visibility depending on other field value
238 'weight' => '', // [int] params with greater weight will be rendered first
239 'group' => '' , // [str] use it to divide your params within groups (tabs)
240 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
241 ),
242 array( // array of parameter
243 'param_name' => 'extra_classes', // [str] must be the same as your parameter name
244 'type' => 'textfield', // [str] attribute type
245 'value' => '', // [str/arr] default attribute's value
246 'def_value' => '', // [str/arr] default attribute's value
247 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
248 'class' => 'extra_classes', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
249 'heading' => __('Extra class name','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
250 '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'),
251 'admin_label' => true, // [bool] show value of param in Visual Composer editor
252 'dependency' => '', // [arr] define param visibility depending on other field value
253 'weight' => '', // [int] params with greater weight will be rendered first
254 'group' => '' , // [str] use it to divide your params within groups (tabs)
255 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
256 )
257
258 // , // another array for another param
259 )
260 );
261
262 // push this node in master_array
263 $master_array[] = $auxin_latest_items_vc;
264
265 return $master_array;
266 }
267
268 add_filter( 'auxin_master_array_shortcodes', 'get_auxin_latest_items_vc', 10, 1 );
269
270
271 // This is the widget call back in fact the front end out put of this widget comes from this function
272 function auxin_widget_latest_items( $atts, $shortcode_content = null ){
273
274
275 // @TODO
276 // Defining default attributes
277 $default_atts = array(
278 'title' => '', // header title
279 'size' => 100, // section size
280 'col' => '33', // one .. six-column
281 'mode' => 'none', // caption-over, none
282 'grid' => '', // custome grid
283 'num' => -1, // fetch num
284 'nav' => 'pagination', // pagination , filterable
285 'title' => '', // widget header title
286 'posttype' => 'post', // posttype
287 'cat_id' => '',
288 'taxonomy' => 'category',
289 'view_excerpt' => 'yes',
290 'view_title' => 'yes',
291 'excerpt_len' => '100',
292 'section_index'=> '',
293 'paged' => '1',
294 'col' => 3,
295 'extra_classes' => '', // custom css class names for this element
296 'custom_el_id' => '', // custom id attribute for this element
297 );
298
299 // Widget Info -----------------------------
300
301 // Widget general info
302 $before_widget = $after_widget = '';
303 $before_title = $after_title = '';
304
305 // If widget info is passed, extract them in above variables
306 if( isset( $atts['widget_info'] ) ){
307 extract( $atts['widget_info'] );
308 }
309 $widget_title = isset( $atts['widget_title'] ) ? $atts['widget_title'] : '';
310
311 // CSS class names for section -------------
312
313 // The default CSS classes for widget container
314 // Note that 'widget-container' should be in all element
315 $default_atts['_css_classes'] = array( 'widget-container' );
316
317 // Parse shortcode attributes
318 $parsed_atts = shortcode_atts( $default_atts, $atts, __FUNCTION__ );
319
320 // Extract array nodes in variables
321 extract( $parsed_atts );
322
323 // Defining extra class names --------------
324
325 // Add extra class names to class list here - widget-{element_name}
326 $_css_classes[] = 'widget-pages'; // @TODO define widget-{element_name}
327
328 // Covering classes in list to class attribute for main section
329 $section_class_attr = auxin_make_html_class_attribute( $_css_classes, $extra_classes );
330
331 $content = wpb_js_remove_wpautop($shortcode_content, true); // fix unclosed/unwanted paragraph tags in $content
332 // TODO: axi should change to aux
333 global $axi_img_size;
334
335 // Defining query base on needs ------------
336
337 // create an id for this section
338 $uid = "axi_pbei".$section_index;
339 if(empty($section_index)) $uid = uniqid("axi_pbei");
340
341 // validate number fetched items
342 $num = ((int)$num > 0)?$num:-1;
343 // set column number to 3 if its empty
344 $col = empty($col)?"1/3":$col;
345
346 // get number of grid column ---------------------------------
347 // actual col size
348 // get number of grid column
349 $wrapper_size = empty($size)?100:$size;
350 $col_actual = ($wrapper_size / 100) * (int)$col;
351 $col_num = floor(100 / $col_actual);
352 $col_num = $col_num > 5?5:$col_num; // max column num is 5
353 // get thumbnsil size name
354 $image_size_name = "i".$col_num;
355
356
357
358 // get all taxonomy items for filtering purpose ---------------
359 $tax_args = array('taxonomy' => $taxonomy, 'terms' => $cat_id );
360
361 if(empty($cat_id) || $cat_id == "all" ) $tax_args = "";
362
363 // get all taxonomy items for filtering purpose ---------------
364 $tax_args = array('taxonomy' => $taxonomy, 'terms' => $cat_id );
365
366 if(empty($cat_id) || $cat_id == "all" ) $tax_args = "";
367
368 // Create wp_query to get pages
369 $query_args = array(
370 'post_type' => $posttype,
371 'orderby' => "menu_order date",
372 'post_status'=> 'publish',
373 'posts_per_page' => $num,
374 'paged' => $paged,
375 'tax_query' => array($tax_args)
376 );
377
378 $query_res = null;
379 $query_res = new WP_Query( $query_args );
380
381 ob_start();
382 ?>
383 <?php echo $before_widget; ?>
384
385 <section id="<?php echo $custom_el_id; ?>" <?php echo $section_class_attr; ?>>
386
387 <?php
388 if( ! empty( $before_title ) ){
389 echo $before_title . $widget_title . $after_title;
390 } elseif( ! empty( $title ) ){
391 echo get_widget_title( $title );
392 }
393 ?>
394
395 <div class="widget-inner">
396
397 <div class="aux-col-wrapper <?php echo "aux-$col"; ?>"> // faghat vase seton
398
399 <?php if( $query_res->have_posts() ): while ( $query_res->have_posts() ) : $query_res->the_post(); ?>
400
401 <article class="aux-col">
402 <!-- @TODO - The output for each element here -->
403 <?php // reset current item image size name
404 $thumb_size = $image_size_name;
405
406 // is current item highlighted?
407 $is_highlight = get_post_meta($th_query->post->ID, 'is_highlighted', true);
408
409 // this is the css class name that indicates the thumbnail size in browser
410 $classSize = "";
411 if($is_highlight == "yes" && $mode == "caption-over"){
412 $classSize = "height2";
413 $thumb_size .= "_2"; // if the item is marked as highlited, make it 2x bigger in height
414 }else{
415 $classSize = "height1";
416 $thumb_size .= "_1";
417 }
418
419 // get suite thumb size
420 $dimentions = $axi_img_size[$thumb_size];
421
422 // retinafy thumbnail
423 $dimentions[0] = 1.8 * $dimentions[0];
424 $dimentions[1] = 1.8 * $dimentions[1];
425 ?>
426
427 <?php // get the current item tag for filtering content
428 $tax_name = 'portfolio-tag';
429 $tax_terms = wp_get_post_terms($th_query->post->ID, $tax_name);
430 // stores all current item tag slugs az class attrs
431 $tax_slugs = "";
432
433 if($tax_terms){
434 foreach($tax_terms as $term)
435 $tax_slugs .= " ".$term->slug;
436 }
437 ?>
438
439 <article class="col" data-filter="<?php echo $tax_slugs; ?>" >
440 <figure>
441 <div class="imgHolder <?php echo $classSize; ?>">
442 <a href="<?php the_permalink(); ?>">
443 <?php
444 auxin_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 70);
445 ?>
446 <?php if ($mode == "caption-over"): ?>
447
448 <em>
449 <?php if($view_title == 'yes'){ ?>
450 <h4><?php the_title(); ?></h4>
451 <?php } ?>
452
453 <?php
454 $cat_terms = wp_get_post_terms(get_the_ID(), 'project-type');
455 if(!empty($cat_terms)){
456 echo '<i>';
457 $cnt = 0;
458 foreach($cat_terms as $term){
459 echo $cnt == 0?'':' / ';
460 echo $term->name;
461 $cnt++;
462 }
463 echo '</i>';
464 }
465 ?>
466 </em>
467
468 <?php endif; ?>
469 </a>
470 </div>
471 <?php if ($mode != "caption-over") { ?>
472
473 <figcaption>
474 <h4 class="fig-title">
475 <?php if($view_title == 'yes'){ ?>
476 <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
477 <?php } ?>
478 </h4>
479 <?php if($view_excerpt == "yes") auxin_the_trimmed_string(get_the_excerpt(),$excerpt_len); ?>
480 </figcaption>
481
482 <?php } ?>
483 </figure>
484 </article>
485 </article>
486 <?php
487 endwhile; endif;
488 wp_reset_query();
489 ?>
490
491 </div><!-- aux-col-wrapper -->
492 </div><!-- widget-inner -->
493 </section><!-- widget-container -->
494
495 <?php echo $after_widget; ?>
496
497 <?php
498 return ob_get_clean();
499 }
500
501