PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.3.14
Shortcodes and extra features for Phlox theme v1.3.14
2.17.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 / recent-posts-masonry.php
auxin-elements / includes / elements Last commit date
about-widget.php 9 years ago accordion-api.php 9 years ago accordion.php 9 years ago attachment-url.php 9 years ago audio.php 9 years ago before-after.php 9 years ago button.php 9 years ago code.php 9 years ago contact-box.php 9 years ago contact-form.php 9 years ago divider.php 9 years ago dropcap.php 9 years ago facebook.php 9 years ago flickr.php 9 years ago gallery.php 9 years ago gmap.php 9 years ago highlight.php 9 years ago image.php 9 years ago instagram-feed.php 9 years ago latest-items.php 10 years ago latest-posts-slider.php 9 years ago popular-posts-widget.php 9 years ago quote.php 9 years ago recent-posts-grid-carousel.php 9 years ago recent-posts-land-style.php 9 years ago recent-posts-masonry.php 9 years ago recent-posts-tiles.php 9 years ago recent-posts-timeline.php 9 years ago recent-posts-widget.php 9 years ago recent-posts.php 9 years ago related-posts.php 9 years ago sample-element.php 9 years ago search.php 9 years ago slider.php 9 years ago socials-list.php 9 years ago tabs-api.php 9 years ago tabs.php 9 years ago text.php 9 years ago touch-slider.php 9 years ago video.php 9 years ago
recent-posts-masonry.php
659 lines
1 <?php
2 /**
3 * Code highlighter element
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author
9 * @link http://averta.net/phlox/
10 * @copyright (c) 2010-2017
11 */
12
13 function auxin_get_recent_posts_masonry_master_array( $master_array ) {
14
15 $categories = get_terms( 'category', 'orderby=count&hide_empty=0' );
16 $categories_list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ;
17 foreach ( $categories as $key => $value ) {
18 $categories_list[$value->term_id] = $value->name;
19 }
20
21 // $tags = get_terms( 'post_tag', 'orderby=count&hide_empty=0' );
22 // $tags_list;
23 // foreach ($tags as $key => $value) {
24 // $tags_list["$value->term_id"] = $value->name;
25 // }
26
27
28 $master_array['aux_recent_posts_masonry'] = array(
29 'name' => __('[Phlox] Masonry Recent Posts', 'auxin-elements' ),
30 'auxin_output_callback' => 'auxin_widget_recent_posts_masonry_callback',
31 'base' => 'aux_recent_posts_masonry',
32 'description' => __('It adds recent posts in masonry style.', 'auxin-elements' ),
33 'class' => 'aux-widget-recent-posts-masonry aux-column-post-entry',
34 'show_settings_on_create' => true,
35 'weight' => 1,
36 'is_widget' => false,
37 'is_shortcode' => true,
38 'is_so' => true,
39 'is_vc' => true,
40 'category' => THEME_NAME,
41 'group' => '',
42 'admin_enqueue_js' => '',
43 'admin_enqueue_css' => '',
44 'front_enqueue_js' => '',
45 'front_enqueue_css' => '',
46 'icon' => 'auxin-element auxin-masonry',
47 'custom_markup' => '',
48 'js_view' => '',
49 'html_template' => '',
50 'deprecated' => '',
51 'content_element' => '',
52 'as_parent' => '',
53 'as_child' => '',
54 'params' => array(
55 array(
56 'heading' => __('Title','auxin-elements' ),
57 'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
58 'param_name' => 'title',
59 'type' => 'textfield',
60 'std' => '',
61 'value' => '',
62 'holder' => 'textfield',
63 'class' => 'title',
64 'admin_label' => false,
65 'dependency' => '',
66 'weight' => '',
67 'group' => '',
68 'edit_field_class' => ''
69 ),
70 array(
71 'heading' => __('Categories', 'auxin-elements'),
72 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
73 'param_name' => 'cat',
74 'type' => 'aux_select2_multiple',
75 'def_value' => ' ',
76 'holder' => '',
77 'class' => 'cat',
78 'value' => $categories_list,
79 'admin_label' => false,
80 'dependency' => '',
81 'weight' => '',
82 'group' => 'Query',
83 'edit_field_class' => ''
84 ),
85 array(
86 'heading' => __('Number of posts to show', 'auxin-elements'),
87 'description' => '',
88 'param_name' => 'num',
89 'type' => 'textfield',
90 'value' => '8',
91 'holder' => '',
92 'class' => 'num',
93 'admin_label' => false,
94 'dependency' => '',
95 'weight' => '',
96 'group' => 'Query',
97 'edit_field_class' => ''
98 ),
99 array(
100 'heading' => __('Exclude posts without media','auxin-elements' ),
101 'description' => '',
102 'param_name' => 'exclude_without_media',
103 'type' => 'aux_switch',
104 'value' => '0',
105 'class' => '',
106 'admin_label' => false,
107 'dependency' => '',
108 'weight' => '',
109 'group' => 'Query',
110 'edit_field_class' => ''
111 ),
112 array(
113 'heading' => __('Exclude custom post formats','auxin-elements' ),
114 'description' => '',
115 'param_name' => 'exclude_custom_post_formats',
116 'type' => 'aux_switch',
117 'value' => '0',
118 'class' => '',
119 'admin_label' => false,
120 'dependency' => '',
121 'weight' => '',
122 'group' => 'Query',
123 'edit_field_class' => ''
124 ),
125 array(
126 'heading' => __('Exclude quote and link post formats','auxin-elements' ),
127 'description' => '',
128 'param_name' => 'exclude_quote_link',
129 'type' => 'aux_switch',
130 'value' => '0',
131 'class' => '',
132 'admin_label' => false,
133 'dependency' => array(
134 'element' => 'exclude_custom_post_formats',
135 'value' => array('0', 'false')
136 ),
137 'weight' => '',
138 'group' => '',
139 'edit_field_class' => ''
140 ),
141 array(
142 'heading' => __('Order by', 'auxin-elements'),
143 'description' => '',
144 'param_name' => 'order_by',
145 'type' => 'dropdown',
146 'def_value' => 'date',
147 'holder' => '',
148 'class' => 'order_by',
149 'value' => array (
150 'date' => __('Date', 'auxin-elements'),
151 'menu_order date' => __('Menu Order', 'auxin-elements'),
152 'title' => __('Title', 'auxin-elements'),
153 'ID' => __('ID', 'auxin-elements'),
154 'rand' => __('Random', 'auxin-elements'),
155 'comment_count' => __('Comments', 'auxin-elements'),
156 'modified' => __('Date Modified', 'auxin-elements'),
157 'author' => __('Author', 'auxin-elements'),
158 'post__in' => __('Inserted Post IDs', 'auxin-elements')
159 ),
160 'admin_label' => false,
161 'dependency' => '',
162 'weight' => '',
163 'group' => 'Query',
164 'edit_field_class' => ''
165 ),
166 array(
167 'heading' => __('Order', 'auxin-elements'),
168 'description' => '',
169 'param_name' => 'order',
170 'type' => 'dropdown',
171 'def_value' => 'DESC',
172 'holder' => '',
173 'class' => 'order',
174 'value' =>array (
175 'DESC' => __('Descending', 'auxin-elements'),
176 'ASC' => __('Ascending', 'auxin-elements'),
177 ),
178 'admin_label' => false,
179 'dependency' => '',
180 'weight' => '',
181 'group' => 'Query',
182 'edit_field_class' => ''
183 ),
184 array(
185 'heading' => __('Only posts','auxin-elements' ),
186 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ),
187 'param_name' => 'only_posts__in',
188 'type' => 'textfield',
189 'value' => '',
190 'holder' => '',
191 'class' => '',
192 'admin_label' => false,
193 'dependency' => '',
194 'weight' => '',
195 'group' => 'Query',
196 'edit_field_class' => ''
197 ),
198 array(
199 'heading' => __('Include posts','auxin-elements' ),
200 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
201 'param_name' => 'include',
202 'type' => 'textfield',
203 'value' => '',
204 'holder' => '',
205 'class' => '',
206 'admin_label' => false,
207 'dependency' => '',
208 'weight' => '',
209 'group' => 'Query',
210 'edit_field_class' => ''
211 ),
212 array(
213 'heading' => __('Exclude posts','auxin-elements' ),
214 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
215 'param_name' => 'exclude',
216 'type' => 'textfield',
217 'value' => '',
218 'holder' => '',
219 'class' => '',
220 'admin_label' => false,
221 'dependency' => '',
222 'weight' => '',
223 'group' => 'Query',
224 'edit_field_class' => ''
225 ),
226 array(
227 'heading' => __('Start offset','auxin-elements' ),
228 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
229 'param_name' => 'offset',
230 'type' => 'textfield',
231 'value' => '',
232 'holder' => '',
233 'class' => '',
234 'admin_label' => false,
235 'dependency' => '',
236 'weight' => '',
237 'group' => 'Query',
238 'edit_field_class' => ''
239 ),
240 array(
241 'heading' => __('Display post media (image, video, etc)', 'auxin-elements' ),
242 'param_name' => 'show_media',
243 'type' => 'aux_switch',
244 'def_value' => '',
245 'value' => '1',
246 'holder' => '',
247 'class' => 'show_media',
248 'admin_label' => false,
249 'dependency' => '',
250 'weight' => '',
251 'group' => '',
252 'edit_field_class' => ''
253 ),
254 array(
255 'heading' => __('Display post title','auxin-elements' ),
256 'description' => '',
257 'param_name' => 'display_title',
258 'type' => 'aux_switch',
259 'value' => '1',
260 'class' => 'display_title',
261 'admin_label' => false,
262 'dependency' => '',
263 'weight' => '',
264 'group' => '',
265 'edit_field_class' => ''
266 ),
267 array(
268 'heading' => __('Display post meta','auxin-elements' ),
269 'description' => '',
270 'param_name' => 'show_info',
271 'type' => 'aux_switch',
272 'value' => '1',
273 'class' => '',
274 'admin_label' => false,
275 'weight' => '',
276 'group' => '',
277 'edit_field_class' => ''
278 ),
279 array(
280 'heading' => __('Display like button','auxin-elements' ),
281 'description' => sprintf(__('Enable it to display %s like button%s on gride template blog. Please note WP Ulike plugin needs to be activaited to use this option.', 'auxin-elements'), '<strong>', '</strong>'),
282 'param_name' => 'display_like',
283 'type' => 'aux_switch',
284 'value' => '1',
285 'holder' => '',
286 'class' => 'display_like',
287 'admin_label' => false,
288 'dependency' => '',
289 'weight' => '',
290 'group' => '',
291 'edit_field_class' => ''
292 ),
293 array(
294 'heading' => __('Excerpt length','auxin-elements' ),
295 'description' => __('Specify summary content in character.','auxin-elements' ),
296 'param_name' => 'excerpt_len',
297 'type' => 'textfield',
298 'value' => '160',
299 'holder' => '',
300 'class' => 'excerpt_len',
301 'admin_label' => false,
302 'dependency' => '',
303 'weight' => '',
304 'group' => '',
305 'edit_field_class' => ''
306 ),
307 array(
308 'heading' => __('Display author or read more', 'auxin-elements'),
309 'description' => __('Specifies whether to show author or read more on each post.', 'auxin-elements'),
310 'param_name' => 'author_or_readmore',
311 'type' => 'dropdown',
312 'def_value' => 'readmore',
313 'holder' => '',
314 'class' => 'author_or_readmore',
315 'value' => array (
316 'readmore' => __('Read More', 'auxin-elements'),
317 'author' => __('Author Name', 'auxin-elements'),
318 ),
319 'admin_label' => false,
320 'dependency' => '',
321 'weight' => '',
322 'group' => '',
323 'edit_field_class' => ''
324 ),
325 array(
326 'heading' => __('Number of columns', 'auxin-elements'),
327 'description' => '',
328 'param_name' => 'desktop_cnum',
329 'type' => 'dropdown',
330 'def_value' => '4',
331 'holder' => '',
332 'class' => 'desktop_cnum',
333 'value' => array(
334 '1' => '1', '2' => '2', '3' => '3',
335 '4' => '4', '5' => '5', '6' => '6'
336 ),
337 'admin_label' => false,
338 'dependency' => '',
339 'weight' => '',
340 'group' => 'Layout',
341 'edit_field_class' => ''
342 ),
343 array(
344 'heading' => __('Number of columns in tablet size', 'auxin-elements'),
345 'description' => '',
346 'param_name' => 'tablet_cnum',
347 'type' => 'dropdown',
348 'value' => 'inherit',
349 'holder' => '',
350 'class' => 'tablet_cnum',
351 'value' => array(
352 'inherit' => 'Inherited from larger',
353 '1' => '1', '2' => '2', '3' => '3',
354 '4' => '4', '5' => '5', '6' => '6'
355 ),
356 'admin_label' => false,
357 'dependency' => '',
358 'weight' => '',
359 'group' => 'Layout',
360 'edit_field_class' => ''
361 ),
362 array(
363 'heading' => __('Number of columns in phone size', 'auxin-elements'),
364 'description' => '',
365 'param_name' => 'phone_cnum',
366 'type' => 'dropdown',
367 'def_value' => '1',
368 'holder' => '',
369 'class' => 'phone_cnum',
370 'value' => array(
371 '1' => '1' , '2' => '2', '3' => '3'
372 ),
373 'admin_label' => false,
374 'dependency' => '',
375 'weight' => '',
376 'group' => 'Layout',
377 'edit_field_class' => ''
378 ),
379 array(
380 'heading' => __('Extra class name','auxin-elements' ),
381 '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' ),
382 'param_name' => 'extra_classes',
383 'type' => 'textfield',
384 'value' => '',
385 'def_value' => '',
386 'holder' => '',
387 'class' => 'extra_classes',
388 'admin_label' => false,
389 'dependency' => '',
390 'weight' => '',
391 'group' => '',
392 'edit_field_class' => ''
393 )
394 )
395 );
396
397 return $master_array;
398 }
399
400 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_recent_posts_masonry_master_array', 10, 1 );
401
402
403
404
405 /**
406 * Element without loop and column
407 * The front-end output of this element is returned by the following function
408 *
409 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
410 * @param string $shortcode_content The shorcode content
411 * @return string The output of element markup
412 */
413 function auxin_widget_recent_posts_masonry_callback( $atts, $shortcode_content = null ){
414
415 global $aux_content_width;
416
417 // Defining default attributes
418 $default_atts = array(
419 'title' => '', // header title
420 'cat' => ' ',
421 'num' => '8', // max generated entry
422 'only_posts__in' => '', // display only these post IDs. array or string comma separated
423 'include' => '', // include these post IDs in result too. array or string comma separated
424 'exclude' => '', // exclude these post IDs from result. array or string comma separated
425 'offset' => '',
426 'paged' => '',
427 'order_by' => 'date',
428 'order' => 'DESC',
429 'exclude_without_media' => 0,
430 'exclude_custom_post_formats' => 0,
431 'exclude_quote_link' => 0,
432 'exclude_post_formats_in' => array(), // the list od post formats to exclude
433 'show_media' => true,
434 'display_like' => true,
435 'display_categories' => true,
436 'content_layout' => 'entry-boxed', // entry-boxed
437 'excerpt_len' => '160',
438 'display_title' => true,
439 'show_excerpt' => true,
440 'show_info' => true,
441 'author_or_readmore' => 'readmore',
442 // 'image_aspect_ratio' => 0.75,
443 'desktop_cnum' => 4,
444 'tablet_cnum' => 'inherit',
445 'phone_cnum' => '1',
446 'tag' => '',
447 'extra_classes' => '',
448 'custom_el_id' => '',
449 'reset_query' => true,
450 'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
451 'wp_query_args' => array(), // additional wp_query args
452 'base_class' => 'aux-widget-recent-posts-masonry aux-column-post-entry'
453 );
454
455 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
456 extract( $result['parsed_atts'] );
457
458 // get content width
459 global $aux_content_width;
460
461 // post-olumn needs to have below variables
462 if( $author_or_readmore == 'readmore') {
463 $show_readmore = true;
464 $show_author_footer = false;
465 } else {
466 $show_author_footer = true;
467 $show_readmore = false;
468 }
469
470 // specify the post formats that should be excluded -------
471 $exclude_post_formats_in = (array) $exclude_post_formats_in;
472
473 if( $exclude_custom_post_formats ){
474 $exclude_post_formats_in = array_merge( $exclude_post_formats_in, array( 'aside', 'gallery', 'image', 'link', 'quote', 'video', 'audio' ) );
475 }
476 if( $exclude_quote_link ){
477 $exclude_post_formats_in[] = 'quote';
478 $exclude_post_formats_in[] = 'link';
479 }
480 $exclude_post_formats_in = array_unique( $exclude_post_formats_in );
481
482 // --------------
483
484 ob_start();
485
486 global $wp_query;
487
488 if( ! $use_wp_query ){
489
490 // create wp_query to get latest items -----------
491 $args = array(
492 'post_type' => 'post',
493 'orderby' => $order_by,
494 'order' => $order,
495 'offset' => $offset,
496 'paged' => $paged,
497 'cat' => $cat,
498 'post_status' => 'publish',
499 'posts_per_page' => $num,
500 'ignore_sticky_posts' => 1,
501
502 'include_posts__in' => $include, // include posts in this list
503 'posts__not_in' => $exclude, // exclude posts in this list
504 'posts__in' => $only_posts__in, // only posts in this list
505
506 'exclude_without_media' => $exclude_without_media,
507 'exclude_post_formats_in' => $exclude_post_formats_in
508 );
509
510 // ---------------------------------------------------------------------
511
512 // add the additional query args if available
513 if( $wp_query_args ){
514 $args = wp_parse_args( $args, $wp_query_args );
515 }
516
517 // pass the args through the auxin query parser
518 $wp_query = new WP_Query( auxin_parse_query_args( $args ) );
519 }
520
521 // widget header ------------------------------
522 echo $result['widget_header'];
523 echo $result['widget_title'];
524
525
526 $phone_break_point = 767;
527 $tablet_break_point = 992;
528
529 $show_comments = true; // shows comments icon
530 $post_counter = 0;
531 $post_classes = '';
532 $column_class = '';
533 $item_class = 'aux-col aux-post-masonry';
534 $carousel_attrs = '';
535 $container_class = 'aux-masonry-layout ';
536 $post_info_position = 'after-title';
537
538 // generate columns class
539 $column_class = $container_class . ' aux-row aux-de-col' . $desktop_cnum;
540 $tablet_cnum = ('inherit' == $tablet_cnum ) ? $desktop_cnum : $tablet_cnum ;
541 $column_class .= ' aux-tb-col'.$tablet_cnum . ' aux-mb-col'.$phone_cnum;
542 $column_class .= 'entry-boxed' == $content_layout ? ' aux-entry-boxed' : '';
543
544
545 $column_media_width = auxin_get_content_column_width( $desktop_cnum, 15 );
546
547 $have_posts = $wp_query->have_posts();
548
549 if( $have_posts ){
550 echo sprintf( '<div class="%s">', $column_class );
551
552 while ( $wp_query->have_posts() ) {
553
554 $wp_query->the_post();
555 $post = $wp_query->post;
556
557 $post_vars = auxin_get_post_format_media(
558 $post,
559 array(
560 'request_from' => 'archive',
561 'media_width' => $phone_break_point,
562 'media_size' => 'large',//array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio ),
563 'upscale_image' => true,
564 'image_from_content' => ! $exclude_without_media, // whether to try to get image from content or not
565 'no_gallery' => false,
566 'add_image_hw' => false, // whether add width and height attr or not
567 'image_sizes' => array(
568 array( 'min' => '', 'max' => '767px', 'width' => '80vw' ),
569 array( 'min' => '768px', 'max' => '992px', 'width' => '40vw' ),
570 array( 'min' => '' , 'max' => '', 'width' => $column_media_width.'px' )
571 ),
572 // 'srcset_sizes' => array(
573 // array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio ),
574 // array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width * $image_aspect_ratio ),
575 // array( 'width' => 4 * $column_media_width, 'height' => 4 * $column_media_width * $image_aspect_ratio )
576 // )
577 )
578 );
579
580 extract( $post_vars );
581
582 $the_format = get_post_format( $post );
583
584 printf( '<div class="%s">', $item_class );
585 include( locate_template( 'templates/theme-parts/entry/post-column.php' ) );
586 echo '</div>';
587 }
588
589 // use it as data attribute on load more button
590 $ajax_nonce = wp_create_nonce( 'post-recent-grid-nonce' );
591
592 echo '</div>';
593 }
594
595 if( $reset_query ){
596 wp_reset_query();
597 }
598
599 // return false if no result found
600 if( ! $have_posts ){
601 ob_get_clean();
602 return false;
603 }
604
605 // widget footer ------------------------------
606 echo $result['widget_footer'];
607
608 return ob_get_clean();
609 }
610
611
612
613
614 /**
615 * Retrieves the markup of a recent post grid
616 *
617 * AJAX Handler: recent-post-grid
618 *
619 * Sample Ajax call:
620 (function($){
621 $.ajax({
622 type : "post",
623 url : auxin.ajaxurl,
624 data : {
625 action : "recent-post-grid",
626 from : 0,
627 to : 10,
628 nonce : ''
629 },
630 success: function(response){
631 if(response.type == "success") {
632
633 } else {
634 alert("Your vote could not be added")
635 }
636 }
637 });
638 })(jQuery);
639 */
640 // function auxin_widget_recent_posts_grid_ajax_callback(){
641
642 // if( empty( $_POST['action'] ) ){
643 // wp_send_json_error( __( 'Action handler not found.', 'auxin-elements' ) );
644 // } elseif( ! wp_verify_nonce( $_POST['nonce'], 'post-recent-grid-nonce' ) ){
645 // wp_send_json_error( __( 'Authorization failed.', 'auxin-elements' ) );
646 // }
647
648 // $from = $_POST['from'];
649 // $to = $_POST['to'];
650
651 // //wp_send_json_success( array() );
652
653 // //wp_send_json_error( __( 'An error occurred.', 'auxin-elements' ) );
654 // }
655
656 add_action( 'wp_ajax_recent-post-grid', 'auxin_widget_recent_posts_grid_ajax_callback' );
657
658
659