WordPress Infinite Scroll – Ajax Load More - Version 2.8.5

Version Description

  • FIX - Update for ALM settings screen - layout was broken with WP 4.4 release.
  • NEW - Adding new functionality to allow for loading of local default repeater template. Users can create a /alm_templates directory within their current theme and add default.php. If default.php is present it will be loaded before repeater template shipped with Ajax Load More.
  • NEW - Adding multiple taxonomy support - you can now query WordPress by up to 3 unique taxonomy queries.
  • NEW - Adding taxonomy_relation shortcode parameter.
  • FIX - Fixed JS error in shortcode builder popup.
  • FIX - Fix for issue with '<' and '<=' Custom Field operators, WP was rendering these tags as HTML (https://github.com/dcooney/wordpress-ajax-load-more/issues/98). Users can now enter 'lessthan' and 'lessthanequalto' to fix this issue.
  • UPDATE - Changing 'exclude' shortcode parameter name to be 'post_not_in' to follow WordPress naming conventions. 'exclude' will continue to work along side 'post_not_in'.
Download this release

Release Info

Developer dcooney
Plugin Icon 128x128 WordPress Infinite Scroll – Ajax Load More
Version 2.8.5
Comparing to
See all releases

Code changes from version 2.8.4 to 2.8.5

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Ajax Load More ===
2
  Contributors: dcooney
3
  Donate link: http://connekthq.com/donate/
4
- Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling
5
  Requires at least: 3.6
6
  Tested up to: 4.4
7
- Stable tag: 2.8.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -58,6 +58,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
58
  * **taxonomy** - Query by custom taxonomy name. Default = null
59
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
60
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
 
61
  * **day** - Day of the week. Default = null
62
  * **month** - Month of the year. Default = null
63
  * **year** - Year of post. Default = null
@@ -69,7 +70,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
69
  * **meta_relation** - Used with multiple custom field entries (AND/OR). Default = ‘AND’
70
  * **author** - Query by author id. Default = null
71
  * **post__in** - Comma separated list of post ID’s to include in query. Default = null
72
- * **exclude** - Comma separated list of post ID’s to exclude from query. Default = null
73
  * **search** - Query search term (‘s’). Default = null
74
  * **custom_args** - A semicolon separated list of value:pair arguments. e.g. tag_slug__and:design,development; event_display:upcoming. Default = null
75
  * **post_status** - Select status of the post. Default = 'publish'
@@ -313,6 +314,16 @@ How to install Ajax Load More.
313
  == Changelog ==
314
 
315
 
 
 
 
 
 
 
 
 
 
 
316
  = 2.8.4 =
317
  * NEW - Adding new loading styles and button types.
318
  * NEW - Adding new 'button_loading_label' parameter allowing users to change button text while loading content.
1
  === Ajax Load More ===
2
  Contributors: dcooney
3
  Donate link: http://connekthq.com/donate/
4
+ Tags: infinite scroll, scroll, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, shortcode builder, wp_query, search, tags, category, post types, comments, taxonomy, meta_query, archives, date, endless, endless scroll
5
  Requires at least: 3.6
6
  Tested up to: 4.4
7
+ Stable tag: 2.8.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
58
  * **taxonomy** - Query by custom taxonomy name. Default = null
59
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
60
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
61
+ * **taxonomy_relation** - The logical relationship between each taxonomy when there is more than one. (AND/OR). Default = ‘AND’
62
  * **day** - Day of the week. Default = null
63
  * **month** - Month of the year. Default = null
64
  * **year** - Year of post. Default = null
70
  * **meta_relation** - Used with multiple custom field entries (AND/OR). Default = ‘AND’
71
  * **author** - Query by author id. Default = null
72
  * **post__in** - Comma separated list of post ID’s to include in query. Default = null
73
+ * **post__not_in** - Comma separated list of post ID’s to exclude from query. Default = null
74
  * **search** - Query search term (‘s’). Default = null
75
  * **custom_args** - A semicolon separated list of value:pair arguments. e.g. tag_slug__and:design,development; event_display:upcoming. Default = null
76
  * **post_status** - Select status of the post. Default = 'publish'
314
  == Changelog ==
315
 
316
 
317
+ = 2.8.5 =
318
+ * FIX - Update for ALM settings screen - layout was broken with WP 4.4 release.
319
+ * NEW - Adding new functionality to allow for loading of local default repeater template. Users can create a /alm_templates directory within their current theme and add default.php. If default.php is present it will be loaded before repeater template shipped with Ajax Load More.
320
+ * NEW - Adding multiple taxonomy support - you can now query WordPress by up to 3 unique taxonomy queries.
321
+ * NEW - Adding taxonomy_relation shortcode parameter.
322
+ * FIX - Fixed JS error in shortcode builder popup.
323
+ * FIX - Fix for issue with '<' and '<=' Custom Field operators, WP was rendering these tags as HTML (https://github.com/dcooney/wordpress-ajax-load-more/issues/98). Users can now enter 'lessthan' and 'lessthanequalto' to fix this issue.
324
+ * UPDATE - Changing 'exclude' shortcode parameter name to be 'post__not_in' to follow WordPress naming conventions. 'exclude' will continue to work along side 'post__not_in'.
325
+
326
+
327
  = 2.8.4 =
328
  * NEW - Adding new loading styles and button types.
329
  * NEW - Adding new 'button_loading_label' parameter allowing users to change button text while loading content.
admin/admin.php CHANGED
@@ -716,6 +716,8 @@ function alm_get_tax_terms(){
716
  die('Get Bounced!');
717
 
718
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
 
 
719
  $tax_args = array(
720
  'orderby' => 'name',
721
  'order' => 'ASC',
@@ -726,11 +728,13 @@ function alm_get_tax_terms(){
726
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
727
  $returnVal .= '<ul>';
728
  foreach ( $terms as $term ) {
729
- //print_r($term);
730
- $returnVal .='<li><input type="checkbox" class="alm_element" name="tax-term-'.$term->slug.'" id="tax-term-'.$term->slug.'" data-type="'.$term->slug.'"><label for="tax-term-'.$term->slug.'">'.$term->name.'</label></li>';
 
731
  }
732
  $returnVal .= '</ul>';
733
  echo $returnVal;
 
734
  die();
735
  }else{
736
  echo "<p class='warning'>No terms exist within this taxonomy</p>";
716
  die('Get Bounced!');
717
 
718
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
719
+ $index = (isset($_GET['index'])) ? $_GET['index'] : '1';
720
+
721
  $tax_args = array(
722
  'orderby' => 'name',
723
  'order' => 'ASC',
728
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
729
  $returnVal .= '<ul>';
730
  foreach ( $terms as $term ) {
731
+
732
+ $returnVal .='<li><input type="checkbox" class="alm_element" name="tax-term-'.$term->slug.'" id="tax-term-'.$term->slug.'-'.$index.'" data-type="'.$term->slug.'"><label for="tax-term-'.$term->slug.'-'.$index.'">'.$term->name.'</label></li>';
733
+
734
  }
735
  $returnVal .= '</ul>';
736
  echo $returnVal;
737
+
738
  die();
739
  }else{
740
  echo "<p class='warning'>No terms exist within this taxonomy</p>";
admin/css/admin.css CHANGED
@@ -317,7 +317,7 @@
317
  clear: both;
318
  margin: 0 0 20px;
319
  padding: 20px 0 0 !important;
320
- overflow:hidden;
321
  position: relative;
322
  }
323
  .ajax-load-more .border-top.controls{
@@ -328,9 +328,9 @@
328
  }
329
 
330
  .ajax-load-more .border-top.highlighted{
331
- background-color: #fafbde;
332
- padding: 10px !important;
333
- border: 1px solid #efefef;
334
  }
335
 
336
  .ajax-load-more .alm-settings-nav{
@@ -369,38 +369,68 @@
369
  border-radius: 3px 0 0 0;
370
  }
371
 
372
-
373
- .meta-query-wrap{}
374
- .ajax-load-more #meta-query-extended .meta-query-wrap .inner{
375
- padding: 0 20px 0 0 !important;
376
- position: relative;
377
- }
378
- .meta-query-wrap .remove-meta-query{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  position: absolute;
380
- right:5px;
381
- bottom:8px;
382
  width: 23px;
383
  height: 23px;
384
- line-height: 19px;
385
  text-align: center;
386
  font-weight: 700;
387
- font-size: 13px;
388
- -webkit-border-radius: 2px;
389
- -moz-border-radius: 2px;
390
- border-radius: 2px;
391
- background-color: #efefef;
392
- color: #999;
393
  text-decoration: none;
394
- border: 1px solid #ccc;
 
 
395
  }
396
- .meta-query-wrap .remove-meta-query:hover{
 
397
  background-color: #cb2222;
398
- border-color: #cb2222;
399
  color: #fff;
400
  }
401
- .meta-query-wrap.removing{
402
- /* background-color: #edd4d4; */
403
- }
404
 
405
  .ajax-load-more .meta-query-wrap .border-top:first-of-type{
406
  padding: 0 0 0 !important;
@@ -411,10 +441,23 @@
411
  .ajax-load-more #nav-controls,
412
  .ajax-load-more #seo-extended,
413
  .ajax-load-more #meta-query-relation,
414
- .ajax-load-more .comments_extras{
 
 
415
  display: none;
416
  overflow: hidden;
417
  }
 
 
 
 
 
 
 
 
 
 
 
418
  .ajax-load-more p.warning{
419
  color: #d24646;
420
  font-size: 13px;
@@ -422,6 +465,9 @@
422
  margin: 0;
423
  padding: 0 0 0 10px;
424
  }
 
 
 
425
 
426
  .ajax-load-more p.warning-callout{
427
  background-color: #cbecf7;
@@ -471,6 +517,10 @@
471
  -moz-box-shadow: none;
472
  box-shadow: none;
473
  }
 
 
 
 
474
 
475
  .ajax-load-more textarea._alm_repeater{
476
  font-family: Consolas, monaco, monospace;
@@ -700,8 +750,8 @@
700
 
701
  .ajax-load-more .section-title {
702
  float: left;
703
- padding: 21px 15px 10px;
704
- width: 45%;
705
  }
706
 
707
  .ajax-load-more .section-title.full {
@@ -710,7 +760,7 @@
710
  }
711
  .ajax-load-more .section-title p{
712
  font-size: 13px !important;
713
- padding-left: 21px !important;
714
  color: #999;
715
  }
716
  .ajax-load-more .section-title p .fa.tooltip,
@@ -742,7 +792,7 @@
742
  color: #666;
743
  }
744
  .ajax-load-more .section-title h4{
745
- padding-left: 21px !important;
746
  margin: 0 0 10px;
747
  }
748
 
@@ -775,17 +825,17 @@
775
 
776
 
777
  .ajax-load-more .row .wrap{
778
- padding: 20px 0 0 3%;
779
  margin: 0;
780
  border: none;
781
- width: 55%;
782
  float: left;
783
  position: relative;
784
  }
785
  .ajax-load-more .row .wrap.full{
786
  float: none;
787
  width: 100%;
788
- padding: 0 15px 10px 36px;
789
  }
790
 
791
 
@@ -2333,8 +2383,8 @@ p.cache-stats{
2333
  display:inline-block;
2334
  padding: 1px 0 0 30px;
2335
  margin: 0 0 5px;
2336
- font-size: 14px;
2337
- line-height: 1.4;
2338
  cursor: pointer !important;
2339
  }
2340
  .shortcode-builder input[type=radio] + label,
317
  clear: both;
318
  margin: 0 0 20px;
319
  padding: 20px 0 0 !important;
320
+ overflow: visible;
321
  position: relative;
322
  }
323
  .ajax-load-more .border-top.controls{
328
  }
329
 
330
  .ajax-load-more .border-top.highlighted{
331
+ background-color: #feffe3;
332
+ padding: 15px !important;
333
+ border: 1px solid #eeefd4;
334
  }
335
 
336
  .ajax-load-more .alm-settings-nav{
369
  border-radius: 3px 0 0 0;
370
  }
371
 
372
+ #meta-query-relation{
373
+ margin: 10px 0 0;
374
+ }
375
+ #meta-query-relation .inner{
376
+ margin: 5px 0 0 !important;
377
+ }
378
+ #alm-meta-key .meta-query-wrap,
379
+ .taxonomy-wrap{
380
+ padding: 15px;
381
+ border: 1px solid #efefef;
382
+ margin: 20px 0 0;
383
+ position: relative;
384
+ }
385
+ .meta-query-wrap.removing,
386
+ .taxonomy-wrap.removing{
387
+ background-color: #f5d0d0;
388
+ }
389
+ #alm-meta-key .meta-query-wrap-first .meta-query-wrap{
390
+ border: none;
391
+ background-color: none;
392
+ padding: 0;
393
+ margin: 0;
394
+ }
395
+ #meta-key .border-top{
396
+ border: none !important;
397
+ }
398
+ .row .controls{
399
+ display: block;
400
+ clear: both;
401
+ padding: 20px 0 0;
402
+ overflow: hidden;
403
+ }
404
+ .row.taxonomy .controls{
405
+ padding-bottom: 20px;
406
+ }
407
+ .row.taxonomy .highlighted{
408
+ margin-bottom: 0 !important;
409
+ }
410
+
411
+ .meta-query-wrap .remove-meta-query,
412
+ .taxonomy-wrap .remove-tax-query{
413
  position: absolute;
414
+ right: 0;
415
+ top: 0;
416
  width: 23px;
417
  height: 23px;
418
+ line-height: 22px;
419
  text-align: center;
420
  font-weight: 700;
421
+ font-size: 20px;
422
+ background-color: #f7f7f7;
423
+ color: #666;
 
 
 
424
  text-decoration: none;
425
+ border: 1px solid #efefef;
426
+ border-top: none;
427
+ border-right: none;
428
  }
429
+ .meta-query-wrap .remove-meta-query:hover,
430
+ .taxonomy-wrap .remove-tax-query:hover{
431
  background-color: #cb2222;
 
432
  color: #fff;
433
  }
 
 
 
434
 
435
  .ajax-load-more .meta-query-wrap .border-top:first-of-type{
436
  padding: 0 0 0 !important;
441
  .ajax-load-more #nav-controls,
442
  .ajax-load-more #seo-extended,
443
  .ajax-load-more #meta-query-relation,
444
+ .ajax-load-more #tax-query-relation,
445
+ .ajax-load-more .comments_extras,
446
+ .ajax-load-more .taxonomy-extended{
447
  display: none;
448
  overflow: hidden;
449
  }
450
+ .ajax-load-more .taxonomy-extended{
451
+ padding-top: 20px;
452
+ }
453
+ .ajax-load-more #tax-query-relation{
454
+ margin-top: 20px;
455
+ }
456
+ .ajax-load-more .taxonomy-wrap{
457
+ display: none;
458
+ position: relative;
459
+ }
460
+ .ajax-load-more .row .wrap .inner
461
  .ajax-load-more p.warning{
462
  color: #d24646;
463
  font-size: 13px;
465
  margin: 0;
466
  padding: 0 0 0 10px;
467
  }
468
+ .ajax-load-more .row .wrap .inner.taxonomy{
469
+ padding-bottom: 0;
470
+ }
471
 
472
  .ajax-load-more p.warning-callout{
473
  background-color: #cbecf7;
517
  -moz-box-shadow: none;
518
  box-shadow: none;
519
  }
520
+
521
+ .controls button.disabled{
522
+ opacity: 0.5;
523
+ }
524
 
525
  .ajax-load-more textarea._alm_repeater{
526
  font-family: Consolas, monaco, monospace;
750
 
751
  .ajax-load-more .section-title {
752
  float: left;
753
+ padding: 20px 0 20px 36px;
754
+ width: 40%;
755
  }
756
 
757
  .ajax-load-more .section-title.full {
760
  }
761
  .ajax-load-more .section-title p{
762
  font-size: 13px !important;
763
+ /* padding-left: 21px !important; */
764
  color: #999;
765
  }
766
  .ajax-load-more .section-title p .fa.tooltip,
792
  color: #666;
793
  }
794
  .ajax-load-more .section-title h4{
795
+ /* padding-left: 21px !important; */
796
  margin: 0 0 10px;
797
  }
798
 
825
 
826
 
827
  .ajax-load-more .row .wrap{
828
+ padding: 20px 0 0 5%;
829
  margin: 0;
830
  border: none;
831
+ width: 58%;
832
  float: left;
833
  position: relative;
834
  }
835
  .ajax-load-more .row .wrap.full{
836
  float: none;
837
  width: 100%;
838
+ padding: 0 15px 15px 36px;
839
  }
840
 
841
 
2383
  display:inline-block;
2384
  padding: 1px 0 0 30px;
2385
  margin: 0 0 5px;
2386
+ font-size: 13px;
2387
+ line-height: 1.42;
2388
  cursor: pointer !important;
2389
  }
2390
  .shortcode-builder input[type=radio] + label,
admin/editor/editor-build.php CHANGED
@@ -3,9 +3,10 @@
3
  <head>
4
  <title>Ajax Load More: Shortcode Builder</title>
5
  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
6
- <link rel="stylesheet" src="<?php echo includes_url($path); ?>js/tinymce/themes/advanced/skins/wp_theme/dialog.css"></link>
7
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/admin.css" />
8
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/select2.css" />
 
9
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
10
  <script type="text/javascript" src="<?php echo includes_url('/js/tinymce/tiny_mce_popup.js'); ?>"></script>
11
  <script type="text/javascript">
@@ -33,7 +34,7 @@ tinyMCEPopup.onInit.add(AjaxLoadMoreModal.init, AjaxLoadMoreModal);
33
  <?php $is_modal = true; ?>
34
  </head>
35
  <body id="alm-builder">
36
- <div id="alm-container" class="ajax-load-more shortcode-builder">
37
  <div class="pop-up-jump">
38
  <div class="jump-menu-wrap">
39
  <select class="jump-menu">
@@ -57,6 +58,17 @@ tinyMCEPopup.onInit.add(AjaxLoadMoreModal.init, AjaxLoadMoreModal);
57
  </div>
58
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>js/libs/select2.min.js"></script>
59
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>shortcode-builder/js/shortcode-builder.js"></script>
 
 
 
 
 
 
 
 
 
 
 
60
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>js/admin.js"></script>
61
  </body>
62
  </html>
3
  <head>
4
  <title>Ajax Load More: Shortcode Builder</title>
5
  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
6
+ <link rel="stylesheet" src="<?php echo includes_url(); ?>js/tinymce/themes/advanced/skins/wp_theme/dialog.css"></link>
7
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/admin.css" />
8
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/select2.css" />
9
+ <link rel="stylesheet" href="<?php echo includes_url(); ?>css/buttons.css" />
10
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
11
  <script type="text/javascript" src="<?php echo includes_url('/js/tinymce/tiny_mce_popup.js'); ?>"></script>
12
  <script type="text/javascript">
34
  <?php $is_modal = true; ?>
35
  </head>
36
  <body id="alm-builder">
37
+ <div id="alm-container" class="ajax-load-more shortcode-builder wp-core-ui">
38
  <div class="pop-up-jump">
39
  <div class="jump-menu-wrap">
40
  <select class="jump-menu">
58
  </div>
59
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>js/libs/select2.min.js"></script>
60
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>shortcode-builder/js/shortcode-builder.js"></script>
61
+ <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>js/libs/jquery.tooltipster.min.js"></script>
62
+ <script type='text/javascript'>
63
+ /* <![CDATA[ */
64
+ var alm_admin_localize = <?php echo json_encode( array(
65
+ 'ajax_admin_url' => admin_url( 'admin-ajax.php' ),
66
+ 'active' => __('Active', 'ajax-load-more'),
67
+ 'inactive' => __('Inactive', 'ajax-load-more'),
68
+ 'alm_admin_nonce' => wp_create_nonce( 'alm_repeater_nonce' )
69
+ )); ?>
70
+ /* ]]> */
71
+ </script>
72
  <script type="text/javascript" src="<?php echo ALM_ADMIN_URL; ?>js/admin.js"></script>
73
  </body>
74
  </html>
admin/shortcode-builder/includes/meta-query-options.php CHANGED
@@ -1,49 +1,48 @@
1
- <div class="inner border-top">
2
- <div class="wrap-30 wrap-50">
3
- <?php // Meta Key ?>
4
- <label for="meta-key" class="full"><?php _e('Key (Name):', 'ajax-load-more'); ?></label>
5
- <input class="alm_element sm meta-key" name="meta-key" type="text" value="" placeholder="<?php _e('Enter custom field key(name)', 'ajax-load-more'); ?>">
6
- </div>
7
- <?php // Meta Value ?>
8
- <div class="wrap-30 wrap-50">
9
- <label for="meta-value" class="full"><?php _e('Value:', 'ajax-load-more'); ?></label>
10
- <input class="alm_element sm meta-value" name="meta-value" type="text" value="" placeholder="<?php _e('Enter custom field value', 'ajax-load-more'); ?>">
11
- </div>
12
- <div class="clear"></div>
13
- <?php // Meta Compare ?>
14
- <div class="wrap-30 wrap-50 padding-top">
15
- <label for="meta-compare" class="full"><?php _e('Operator:', 'ajax-load-more'); ?></label>
16
- <select class="alm_element meta-compare" name="meta-compare">
17
- <option value="IN" selected="selected">IN</option>
18
- <option value="NOT IN">NOT IN</option>
19
- <option value="BETWEEN">BETWEEN</option>
20
- <option value="NOT BETWEEN">NOT BETWEEN</option>
21
- <option value="=">= &nbsp;&nbsp; (equals)</option>
22
- <option value="!=">!= &nbsp; (does NOT equal)</option>
23
- <option value=">">> &nbsp;&nbsp; (greater than)</option>
24
- <option value=">=">>= &nbsp;(greater than or equal to)</option>
25
- <option value="<">&lt; &nbsp;&nbsp; (less than)</option>
26
- <option value="<=">&lt;= &nbsp;(less than or equal to)</option>
27
- <option value="LIKE">LIKE</option>
28
- <option value="NOT LIKE">NOT LIKE</option>
29
- <option value="EXISTS">EXISTS</option>
30
- <option value="NOT EXISTS">NOT EXISTS</option>
31
- </select>
32
- </div>
33
- <?php // Meta Type ?>
34
- <div class="wrap-30 wrap-50 padding-top">
35
- <label for="meta-type" class="full"><?php _e('Type:', 'ajax-load-more'); ?></label>
36
- <select class="alm_element meta-type" name="meta-type">
37
- <option value="BINARY">BINARY</option>
38
- <option value="CHAR" selected="selected">CHAR</option>
39
- <option value="DATE">DATE</option>
40
- <option value="DATETIME">DATETIME</option>
41
- <option value="DECIMAL">DECIMAL</option>
42
- <option value="NUMERIC">NUMERIC</option>
43
- <option value="SIGNED">SIGNED</option>
44
- <option value="TIME">TIME</option>
45
- <option value="UNSIGNED">UNSIGNED</option>
46
- </select>
47
- </div>
48
- <a class="remove remove-meta-query" href="javascript:void(0);"><i class="fa fa-remove"></i></a>
49
- </div>
1
+
2
+ <div class="wrap-30 wrap-50">
3
+ <?php // Meta Key ?>
4
+ <label for="meta-key" class="full"><?php _e('Key (Name):', 'ajax-load-more'); ?></label>
5
+ <input class="alm_element sm meta-key" name="meta-key" type="text" value="" placeholder="<?php _e('Enter custom field key(name)', 'ajax-load-more'); ?>">
6
+ </div>
7
+ <?php // Meta Value ?>
8
+ <div class="wrap-30 wrap-50">
9
+ <label for="meta-value" class="full"><?php _e('Value:', 'ajax-load-more'); ?></label>
10
+ <input class="alm_element sm meta-value" name="meta-value" type="text" value="" placeholder="<?php _e('Enter custom field value', 'ajax-load-more'); ?>">
11
+ </div>
12
+ <div class="clear"></div>
13
+ <?php // Meta Compare ?>
14
+ <div class="wrap-30 wrap-50 padding-top">
15
+ <label for="meta-compare" class="full"><?php _e('Operator:', 'ajax-load-more'); ?></label>
16
+ <select class="alm_element meta-compare" name="meta-compare">
17
+ <option value="IN" selected="selected">IN</option>
18
+ <option value="NOT IN">NOT IN</option>
19
+ <option value="BETWEEN">BETWEEN</option>
20
+ <option value="NOT BETWEEN">NOT BETWEEN</option>
21
+ <option value="=">= &nbsp;&nbsp; (equals)</option>
22
+ <option value="!=">!= &nbsp; (does NOT equal)</option>
23
+ <option value=">">> &nbsp;&nbsp; (greater than)</option>
24
+ <option value=">=">>= &nbsp;(greater than or equal to)</option>
25
+ <option value="<">&lt; &nbsp;&nbsp; (less than)</option>
26
+ <option value="<=">&lt;= &nbsp;(less than or equal to)</option>
27
+ <option value="LIKE">LIKE</option>
28
+ <option value="NOT LIKE">NOT LIKE</option>
29
+ <option value="EXISTS">EXISTS</option>
30
+ <option value="NOT EXISTS">NOT EXISTS</option>
31
+ </select>
32
+ </div>
33
+ <?php // Meta Type ?>
34
+ <div class="wrap-30 wrap-50 padding-top">
35
+ <label for="meta-type" class="full"><?php _e('Type:', 'ajax-load-more'); ?></label>
36
+ <select class="alm_element meta-type" name="meta-type">
37
+ <option value="BINARY">BINARY</option>
38
+ <option value="CHAR" selected="selected">CHAR</option>
39
+ <option value="DATE">DATE</option>
40
+ <option value="DATETIME">DATETIME</option>
41
+ <option value="DECIMAL">DECIMAL</option>
42
+ <option value="NUMERIC">NUMERIC</option>
43
+ <option value="SIGNED">SIGNED</option>
44
+ <option value="TIME">TIME</option>
45
+ <option value="UNSIGNED">UNSIGNED</option>
46
+ </select>
47
+ </div>
48
+ <a class="remove remove-meta-query" href="javascript:void(0);">&times;</a>
 
admin/shortcode-builder/includes/tax-query-options.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php #1 ?>
2
+ <div class="inner taxonomy">
3
+ <label class="full"><?php _e('Taxonomy:', 'ajax-load-more'); ?></label>
4
+ <select class="alm_element" name="taxonomy-select" id="taxonomy-select">
5
+ <option value="" selected="selected">-- <?php _e('Select Taxonomy', 'ajax-load-more'); ?>--</option>
6
+ <?php foreach( $taxonomies as $taxonomy ){ ?>
7
+ <option name="chk-<?php echo $taxonomy->query_var; ?>" id="chk-<?php echo $taxonomy->query_var; ?>" value="<?php echo $taxonomy->query_var;?>"><?php echo $taxonomy->label; ?></option>
8
+ <?php } ?>
9
+ </select>
10
+
11
+ <div class="taxonomy-extended">
12
+ <label class="full"><?php _e('Taxonomy Terms:', 'ajax-load-more'); ?></label>
13
+ <div id="tax-terms-container1" class="tax-terms-container checkboxes"></div>
14
+ </div>
15
+
16
+ <div class="taxonomy-extended" id="tax-operator-select">
17
+ <label class="full"><?php _e('Taxonomy Operator:', 'ajax-load-more'); ?></label>
18
+ <ul class="radio">
19
+ <li>
20
+ <input class="alm_element" name="tax-operator" id="tax-in-radio" value="IN" type="radio" checked="checked">
21
+ <label for="tax-in-radio">IN (default)</label>
22
+ </li>
23
+ <li>
24
+ <input class="alm_element" name="tax-operator" id="tax-not-in-radio" value="NOT IN" type="radio">
25
+ <label for="tax-not-in-radio">NOT IN</label>
26
+ </li>
27
+ </ul>
28
+ </div>
29
+
30
+ </div>
31
+ <div class="clear"></div>
32
+
33
+ <div id="tax-query-relation">
34
+ <div class="inner border-top highlighted">
35
+ <div class="wrap-30 wrap-50">
36
+ <label for="tax-relation" class="full"><?php _e('Relation:', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('The logical relationship between each taxonomy when there is more than one.','ajax-load-more'); ?>"></a></label>
37
+ <select class="alm_element tax-relation" name="tax-relation">
38
+ <option value="AND" selected="selected">AND</option>
39
+ <option value="OR">OR</option>
40
+ </select>
41
+ </div>
42
+ </div>
43
+ </div>
44
+
45
+ <?php #2 ?>
46
+ <div class="taxonomy taxonomy-wrap">
47
+ <label class="full"><?php _e('Taxonomy:', 'ajax-load-more'); ?></label>
48
+ <a class="remove remove-tax-query" href="javascript:void(0);">&times;</a>
49
+ <select class="alm_element" name="taxonomy-select2" id="taxonomy-select2">
50
+ <option value="" selected="selected">-- <?php _e('Select Taxonomy', 'ajax-load-more'); ?>--</option>
51
+ <?php foreach( $taxonomies as $taxonomy ){ ?>
52
+ <option name="chk-<?php echo $taxonomy->query_var; ?>" id="chk-<?php echo $taxonomy->query_var; ?>" value="<?php echo $taxonomy->query_var;?>"><?php echo $taxonomy->label; ?></option>
53
+ <?php } ?>
54
+ </select>
55
+
56
+ <div class="taxonomy-extended">
57
+ <label class="full"><?php _e('Taxonomy Terms:', 'ajax-load-more'); ?></label>
58
+ <div id="tax-terms-container2" class="tax-terms-container checkboxes"></div>
59
+ </div>
60
+
61
+ <div class="taxonomy-extended" id="tax-operator-select2">
62
+ <label class="full"><?php _e('Taxonomy Operator:', 'ajax-load-more'); ?></label>
63
+ <ul class="radio">
64
+ <li>
65
+ <input class="alm_element" name="tax-operator2" id="tax-in-radio2" value="IN" type="radio" checked="checked">
66
+ <label for="tax-in-radio2">IN (default)</label>
67
+ </li>
68
+ <li>
69
+ <input class="alm_element" name="tax-operator2" id="tax-not-in-radio2" value="NOT IN" type="radio">
70
+ <label for="tax-not-in-radio2">NOT IN</label>
71
+ </li>
72
+ </ul>
73
+ </div>
74
+ </div>
75
+
76
+ <?php #3 ?>
77
+ <div class="taxonomy taxonomy-wrap">
78
+ <label class="full"><?php _e('Taxonomy:', 'ajax-load-more'); ?></label>
79
+ <a class="remove remove-tax-query" href="javascript:void(0);">&times;</a>
80
+ <select class="alm_element" name="taxonomy-select3" id="taxonomy-select3">
81
+ <option value="" selected="selected">-- <?php _e('Select Taxonomy', 'ajax-load-more'); ?>--</option>
82
+ <?php foreach( $taxonomies as $taxonomy ){ ?>
83
+ <option name="chk-<?php echo $taxonomy->query_var; ?>" id="chk-<?php echo $taxonomy->query_var; ?>" value="<?php echo $taxonomy->query_var;?>"><?php echo $taxonomy->label; ?></option>
84
+ <?php } ?>
85
+ </select>
86
+
87
+ <div class="taxonomy-extended">
88
+ <label class="full"><?php _e('Taxonomy Terms:', 'ajax-load-more'); ?></label>
89
+ <div id="tax-terms-container3" class="tax-terms-container checkboxes"></div>
90
+ </div>
91
+
92
+ <div class="taxonomy-extended" id="tax-operator-select3">
93
+ <label class="full"><?php _e('Taxonomy Operator:', 'ajax-load-more'); ?></label>
94
+ <ul class="radio">
95
+ <li>
96
+ <input class="alm_element" name="tax-operator3" id="tax-in-radio3" value="IN" type="radio" checked="checked">
97
+ <label for="tax-in-radio3">IN (default)</label>
98
+ </li>
99
+ <li>
100
+ <input class="alm_element" name="tax-operator3" id="tax-not-in-radio3" value="NOT IN" type="radio">
101
+ <label for="tax-not-in-radio3">NOT IN</label>
102
+ </li>
103
+ </ul>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="clear"></div>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -41,6 +41,54 @@ jQuery(document).ready(function($) {
41
  $('.ajax-load-more .tags select.multiple').select2();
42
  };
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
 
46
  // Add additional meta_query
@@ -51,7 +99,7 @@ jQuery(document).ready(function($) {
51
  e.preventDefault();
52
 
53
  if($('.meta-query-wrap').length > 3){
54
- alert("Sorry, There is a maximum of 4 meta_query objects.");
55
  return false;
56
  }
57
 
@@ -59,19 +107,19 @@ jQuery(document).ready(function($) {
59
  $('input, select', meta_query_obj).val('');
60
  var el = meta_query_obj.clone().hide();
61
  target.append(el);
62
- el.fadeIn(200);
63
  $('#meta-query-extended select').select2();
64
 
65
  if($('.meta-query-wrap').length > 1){
66
- $('#meta-query-relation').fadeIn(150);
67
  }else{
68
- $('#meta-query-relation').fadeOut(150);
69
  }
70
 
71
  $('select.meta-compare').select2();
72
 
73
  if($('.meta-query-wrap').length > 3){ // Hide "Add" button if 4 $('.meta-query-wrap')
74
- $('#alm-meta-key .controls').delay(200).slideUp(150, 'alm_easeInOutQuad');
75
  }
76
 
77
  });
@@ -79,14 +127,14 @@ jQuery(document).ready(function($) {
79
  /* Delete Meta Query */
80
  $(document).on('click', '.remove-meta-query', function(e){
81
  var el = $(this);
82
- el.parent().parent('.meta-query-wrap').addClass('removing');
83
- el.parent().parent('.meta-query-wrap').fadeOut(200, function(){
84
- el.parent().parent('.meta-query-wrap').remove();
85
  _alm.buildShortcode();
86
  });
87
 
88
  if($('.meta-query-wrap').length > 3){ // Show "Add" button if less than 4 $('.meta-query-wrap')
89
- $('#alm-meta-key .controls').delay(200).slideDown(200, 'alm_easeInOutQuad');
90
  }
91
 
92
  });
@@ -168,6 +216,7 @@ jQuery(document).ready(function($) {
168
  }
169
 
170
 
 
171
  // ---------------------------
172
  // - PAGING
173
  // ---------------------------
@@ -186,8 +235,7 @@ jQuery(document).ready(function($) {
186
  $('#nav-controls').slideDown(100, 'alm_easeInOutQuad');
187
  }else{
188
  $('#nav-controls').slideUp(100, 'alm_easeInOutQuad');
189
- }
190
-
191
 
192
 
193
 
@@ -234,6 +282,7 @@ jQuery(document).ready(function($) {
234
  }
235
 
236
 
 
237
  // ---------------------------
238
  // - SEO
239
  // ---------------------------
@@ -245,6 +294,8 @@ jQuery(document).ready(function($) {
245
  output += ' seo="'+seo+'"';
246
  }
247
 
 
 
248
  // ---------------------------
249
  // - Repeater
250
  // ---------------------------
@@ -283,9 +334,10 @@ jQuery(document).ready(function($) {
283
  });
284
  if(post_type_count>0){
285
  output += '"';
286
- }
287
-
288
  }
 
 
289
 
290
  // ---------------------------
291
  // - Post Format
@@ -325,43 +377,133 @@ jQuery(document).ready(function($) {
325
  output += ' tag__not_in="'+tag_not_in+'"';
326
 
327
 
 
328
  // ---------------------------
329
  // - Taxonomy Query
330
  // ---------------------------
331
 
332
- var tax = $('select#taxonomy-select').val(),
333
- tax_operator = $('#tax-operator-select input[name=tax-operator]:checked').val();
334
-
335
- if(tax !== '' && tax !== undefined){
336
- output += ' taxonomy="'+tax+'"';
337
- if($('select#taxonomy-select').hasClass('changed')){
338
- $('#taxonomy-extended').slideDown(200, 'alm_easeInOutQuad');
339
- get_tax_terms(tax);
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  $('select#taxonomy-select').removeClass('changed');
341
  }
342
 
343
- var tax_term_count = 0;
344
- $('#tax-terms-container input[type=checkbox]').each(function(e){
345
- if($(this).is(":checked")) {
346
- tax_term_count++;
347
- if(tax_term_count>1){
348
- output += ', ' + $(this).data('type');
349
- }else{
350
- if($('#tax-terms-container input').hasClass('changed'))
351
- output += ' taxonomy_terms="'+$(this).data('type')+'';
 
352
  }
353
- }
354
- });
355
- if(tax_term_count>0)
356
- output += '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
- //Get Tax Operator
359
- if(tax_operator !== '' && tax_operator !== 'IN' && tax_operator !== undefined && tax_term_count !== 0){
360
- output += ' taxonomy_operator="'+tax_operator+'"';
361
- }
362
- }else{
363
- $('#taxonomy-extended').slideUp(200, 'alm_easeInOutQuad');
 
 
 
 
 
 
 
 
 
364
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
 
367
  // ---------------------------
@@ -393,7 +535,7 @@ jQuery(document).ready(function($) {
393
  meta_type = $('.meta-query-wrap').eq(0).find('select.meta-type').val(),
394
  meta_relation = $('select.meta-relation').val(),
395
  meta_query_length = $('.meta-query-wrap').length;
396
-
397
  // Set meta_compare default value
398
  if(meta_compare === '' || meta_compare == undefined)
399
  meta_compare = '=';
@@ -491,7 +633,7 @@ jQuery(document).ready(function($) {
491
  if(exclude.charAt( exclude.length-1 ) == ",") {
492
  exclude = exclude.slice(0, -1)
493
  }
494
- output += ' exclude="'+exclude+'"';
495
  }
496
 
497
 
@@ -807,21 +949,22 @@ jQuery(document).ready(function($) {
807
  *
808
  * @since 2.1.0
809
  */
810
- function get_tax_terms(tax){
811
- var placement = $('#tax-terms-container');
812
  placement.html("<p class='loading'>Fetching Terms...</p>");
 
813
  $.ajax({
814
  type: 'GET',
815
- url: window.parent.alm_admin_localize.ajax_admin_url,
816
  data: {
817
  action: 'alm_get_tax_terms',
818
  taxonomy: tax,
819
- nonce: window.parent.alm_admin_localize.alm_admin_nonce,
 
820
  },
821
  dataType: "html",
822
- success: function(data) {
823
- //console.log(data);
824
- placement.html(data);
825
  },
826
  error: function(xhr, status, error) {
827
  responseText.html('<p>Error - Something went wrong and the terms could not be retrieved.');
@@ -884,6 +1027,8 @@ jQuery(document).ready(function($) {
884
  $(document).on('click', '.reset-shortcode-builder a', function(){
885
  $('#alm-shortcode-builder-form').trigger("reset");
886
  _alm.reset_select2();
 
 
887
  _alm.buildShortcode();
888
  });
889
 
41
  $('.ajax-load-more .tags select.multiple').select2();
42
  };
43
 
44
+
45
+
46
+ //
47
+ var total_tax_query = 0,
48
+ max_tax_query = 2;
49
+ $('#add-tax-query').on('click', function(e){
50
+ e.preventDefault();
51
+
52
+ if(total_tax_query < 2){
53
+ total_tax_query++;
54
+ $('#tax-query-relation').fadeIn(250);
55
+ $('.ajax-load-more .taxonomy-wrap').eq(total_tax_query - 1).fadeIn(250);
56
+
57
+ if(total_tax_query === 2){ // Hide "Add" button if 3 $('.taxonomy-wrap')
58
+ $('#alm-taxonomy .controls button').addClass('disabled');
59
+ }
60
+
61
+ }else{
62
+ alert("Sorry - maximum of 3 tax_query objects.");
63
+ return false;
64
+ }
65
+
66
+ });
67
+
68
+ /* Delete Tax Query */
69
+ $(document).on('click', '.remove-tax-query', function(e){
70
+ var el = $(this),
71
+ parent = el.parent('.taxonomy-wrap');
72
+
73
+ $('select', parent).select2('val', '').trigger('change');
74
+ total_tax_query--;
75
+ parent.addClass('removing');
76
+ parent.fadeOut(250, function(){
77
+ _alm.buildShortcode();
78
+ parent.removeClass('removing');
79
+ });
80
+
81
+ if(total_tax_query < 2){ // Show "Add" button if less than 3
82
+ $('#alm-taxonomy .controls button').removeClass('disabled');
83
+ }
84
+
85
+ if(total_tax_query == 0){
86
+ $('#tax-query-relation').fadeOut(250);
87
+ }
88
+
89
+ });
90
+
91
+
92
 
93
 
94
  // Add additional meta_query
99
  e.preventDefault();
100
 
101
  if($('.meta-query-wrap').length > 3){
102
+ alert("Sorry - maximum of 4 meta_query objects.");
103
  return false;
104
  }
105
 
107
  $('input, select', meta_query_obj).val('');
108
  var el = meta_query_obj.clone().hide();
109
  target.append(el);
110
+ el.fadeIn(250);
111
  $('#meta-query-extended select').select2();
112
 
113
  if($('.meta-query-wrap').length > 1){
114
+ $('#meta-query-relation').fadeIn(250);
115
  }else{
116
+ $('#meta-query-relation').fadeOut(250);
117
  }
118
 
119
  $('select.meta-compare').select2();
120
 
121
  if($('.meta-query-wrap').length > 3){ // Hide "Add" button if 4 $('.meta-query-wrap')
122
+ $('#alm-meta-key .controls button').addClass('disabled');
123
  }
124
 
125
  });
127
  /* Delete Meta Query */
128
  $(document).on('click', '.remove-meta-query', function(e){
129
  var el = $(this);
130
+ el.parent('.meta-query-wrap').addClass('removing');
131
+ el.parent('.meta-query-wrap').fadeOut(250, function(){
132
+ el.parent('.meta-query-wrap').remove();
133
  _alm.buildShortcode();
134
  });
135
 
136
  if($('.meta-query-wrap').length > 3){ // Show "Add" button if less than 4 $('.meta-query-wrap')
137
+ $('#alm-meta-key .controls button').removeClass('disabled');
138
  }
139
 
140
  });
216
  }
217
 
218
 
219
+
220
  // ---------------------------
221
  // - PAGING
222
  // ---------------------------
235
  $('#nav-controls').slideDown(100, 'alm_easeInOutQuad');
236
  }else{
237
  $('#nav-controls').slideUp(100, 'alm_easeInOutQuad');
238
+ }
 
239
 
240
 
241
 
282
  }
283
 
284
 
285
+
286
  // ---------------------------
287
  // - SEO
288
  // ---------------------------
294
  output += ' seo="'+seo+'"';
295
  }
296
 
297
+
298
+
299
  // ---------------------------
300
  // - Repeater
301
  // ---------------------------
334
  });
335
  if(post_type_count>0){
336
  output += '"';
337
+ }
 
338
  }
339
+
340
+
341
 
342
  // ---------------------------
343
  // - Post Format
377
  output += ' tag__not_in="'+tag_not_in+'"';
378
 
379
 
380
+
381
  // ---------------------------
382
  // - Taxonomy Query
383
  // ---------------------------
384
 
385
+ var tax1 = $.trim($('select#taxonomy-select').val()),
386
+ tax_operator1 = $.trim($('#tax-operator-select input[name=tax-operator]:checked').val()),
387
+ tax2 = $.trim($('select#taxonomy-select2').val()),
388
+ tax_operator2 = $.trim($('#tax-operator-select2 input[name=tax-operator2]:checked').val()),
389
+ tax3 = $.trim($('select#taxonomy-select3').val()),
390
+ tax_operator3 = $.trim($('#tax-operator-select3 input[name=tax-operator3]:checked').val()),
391
+ tax_relation = $.trim($('#tax-query-relation select[name=tax-relation]').val());
392
+
393
+ var parent1 = $('select#taxonomy-select').parent('.taxonomy'),
394
+ parent2 = $('select#taxonomy-select2').parent('.taxonomy'),
395
+ parent3 = $('select#taxonomy-select3').parent('.taxonomy');
396
+
397
+ var has_tax1 = false,
398
+ taxonomy1_terms = '';
399
+ if(tax1 !== '' && tax1 !== undefined){
400
+
401
+ has_tax1 = true;
402
+ if($('select#taxonomy-select').hasClass('changed')){
403
+ $('select#taxonomy-select').parent()
404
+ $('.taxonomy-extended', parent1).fadeIn(150, 'alm_easeInOutQuad');
405
+ get_tax_terms(tax1, parent1, '1');
406
  $('select#taxonomy-select').removeClass('changed');
407
  }
408
 
409
+ var tax_term_count1 = 0;
410
+ $('#tax-terms-container1 input[type=checkbox]').each(function(e){
411
+ if($(this).is(":checked")) {
412
+ tax_term_count1++;
413
+ if(tax_term_count1 > 1){
414
+ taxonomy1_terms += ', ' + $(this).data('type');
415
+ }else{
416
+ if($('#tax-terms-container1 input').hasClass('changed'))
417
+ taxonomy1_terms += $(this).data('type');
418
+ }
419
  }
420
+ });
421
+ }
422
+ else{
423
+ $('.taxonomy-extended', parent1).fadeOut(150, 'alm_easeInOutQuad');
424
+ }
425
+
426
+
427
+ var has_tax2 = false,
428
+ taxonomy2_terms = '';
429
+ if(tax2 !== '' && tax2 !== undefined){
430
+
431
+ has_tax2 = true;
432
+ if($('select#taxonomy-select2').hasClass('changed')){
433
+ $('select#taxonomy-select2').parent()
434
+ $('.taxonomy-extended', parent2).fadeIn(200, 'alm_easeInOutQuad');
435
+ get_tax_terms(tax2, parent2, '2');
436
+ $('select#taxonomy-select2').removeClass('changed');
437
+ }
438
 
439
+ var tax_term_count2 = 0;
440
+ $('#tax-terms-container2 input[type=checkbox]').each(function(e){
441
+ if($(this).is(":checked")) {
442
+ tax_term_count2++;
443
+ if(tax_term_count2 > 1){
444
+ taxonomy2_terms += ', ' + $(this).data('type');
445
+ }else{
446
+ if($('#tax-terms-container2 input').hasClass('changed'))
447
+ taxonomy2_terms += $(this).data('type');
448
+ }
449
+ }
450
+ });
451
+ }
452
+ else{
453
+ $('.taxonomy-extended', parent2).fadeOut(150, 'alm_easeInOutQuad');
454
  }
455
+
456
+
457
+ var has_tax3,
458
+ taxonomy3_terms = '';
459
+ if(tax3 !== '' && tax3 !== undefined){
460
+
461
+ has_tax3 = true;
462
+ if($('select#taxonomy-select3').hasClass('changed')){
463
+ $('select#taxonomy-select3').parent()
464
+ $('.taxonomy-extended', parent3).fadeIn(200, 'alm_easeInOutQuad');
465
+ get_tax_terms(tax3, parent3, '3');
466
+ $('select#taxonomy-select3').removeClass('changed');
467
+ }
468
+
469
+ var tax_term_count3 = 0;
470
+ $('#tax-terms-container3 input[type=checkbox]').each(function(e){
471
+ if($(this).is(":checked")) {
472
+ tax_term_count3++;
473
+ if(tax_term_count3 > 1){
474
+ taxonomy3_terms += ', ' + $(this).data('type');
475
+ }else{
476
+ if($('#tax-terms-container3 input').hasClass('changed'))
477
+ taxonomy3_terms += $(this).data('type');
478
+ }
479
+ }
480
+ });
481
+ }
482
+ else{
483
+ $('.taxonomy-extended', parent3).fadeOut(150, 'alm_easeInOutQuad');
484
+ }
485
+
486
+
487
+ if(has_tax1 && !has_tax2 && !has_tax3){
488
+ output += ' taxonomy="'+tax1+'"';
489
+ output += ' taxonomy_terms="'+taxonomy1_terms+'"';
490
+ output += ' taxonomy_operator="'+tax_operator1+'"';
491
+ }
492
+ if(has_tax1 && has_tax2 && !has_tax3){
493
+ output += ' taxonomy="'+tax1+':'+tax2+'"';
494
+ output += ' taxonomy_terms="'+taxonomy1_terms+':'+taxonomy2_terms+'"';
495
+ output += ' taxonomy_operator="'+tax_operator1+':'+tax_operator2+'"';
496
+ if(tax_relation !== 'AND')
497
+ output += ' taxonomy_relation="'+tax_relation;
498
+ }
499
+ if(has_tax1 && has_tax2 && has_tax3){
500
+ output += ' taxonomy="'+tax1+':'+tax2+':'+tax3+'"';
501
+ output += ' taxonomy_terms="'+taxonomy1_terms+':'+taxonomy2_terms+':'+taxonomy3_terms+'"';
502
+ output += ' taxonomy_operator="'+tax_operator1+':'+tax_operator2+':'+tax_operator3+'"';
503
+ if(tax_relation !== 'AND')
504
+ output += ' taxonomy_relation="'+tax_relation;
505
+ }
506
+
507
 
508
 
509
  // ---------------------------
535
  meta_type = $('.meta-query-wrap').eq(0).find('select.meta-type').val(),
536
  meta_relation = $('select.meta-relation').val(),
537
  meta_query_length = $('.meta-query-wrap').length;
538
+
539
  // Set meta_compare default value
540
  if(meta_compare === '' || meta_compare == undefined)
541
  meta_compare = '=';
633
  if(exclude.charAt( exclude.length-1 ) == ",") {
634
  exclude = exclude.slice(0, -1)
635
  }
636
+ output += ' post__not_in="'+exclude+'"';
637
  }
638
 
639
 
949
  *
950
  * @since 2.1.0
951
  */
952
+ function get_tax_terms(tax, parent, index){
953
+ var placement = $('.tax-terms-container', parent);
954
  placement.html("<p class='loading'>Fetching Terms...</p>");
955
+
956
  $.ajax({
957
  type: 'GET',
958
+ url: alm_admin_localize.ajax_admin_url,
959
  data: {
960
  action: 'alm_get_tax_terms',
961
  taxonomy: tax,
962
+ index: index,
963
+ nonce: alm_admin_localize.alm_admin_nonce,
964
  },
965
  dataType: "html",
966
+ success: function(data) {
967
+ placement.html(data);
 
968
  },
969
  error: function(xhr, status, error) {
970
  responseText.html('<p>Error - Something went wrong and the terms could not be retrieved.');
1027
  $(document).on('click', '.reset-shortcode-builder a', function(){
1028
  $('#alm-shortcode-builder-form').trigger("reset");
1029
  _alm.reset_select2();
1030
+ //total_tax_query = 0;
1031
+ //$('.ajax-load-more .taxonomy-wrap').hide();
1032
  _alm.buildShortcode();
1033
  });
1034
 
admin/shortcode-builder/shortcode-builder.php CHANGED
@@ -363,6 +363,7 @@
363
  </div>
364
  </div>
365
 
 
366
  <div class="clear"></div>
367
  <hr>
368
  <div class="section-title">
@@ -641,44 +642,22 @@
641
  );
642
  $tax_output = 'objects';
643
  $taxonomies = get_taxonomies( $tax_args, $tax_output );
644
- if ( $taxonomies ) {
645
- echo '<div class="row taxonomy" id="alm-taxonomy">';
646
- echo '<h3 class="heading">'.__('Taxonomy', 'ajax-load-more'). '</h3>';
647
- echo '<div class="expand-wrap">';
648
- echo '<div class="section-title">';
649
- echo '<p>'.__('Select your custom taxonomy then select the terms and operator.', 'ajax-load-more'). '</p>';
650
- echo '</div>';
651
-
652
- echo '<div class="wrap">';
653
-
654
- echo '<div class="inner">';
655
- echo '<select class="alm_element" name="taxonomy-select" id="taxonomy-select">';
656
- echo '<option value="" selected="selected">-- ' . __('Select Taxonomy', 'ajax-load-more') . ' --</option>';
657
- foreach( $taxonomies as $taxonomy ){
658
- echo '<option name="chk-'.$taxonomy->query_var.'" id="chk-'.$taxonomy->query_var.'" value="'.$taxonomy->query_var.'">'.$taxonomy->label.'</option>';
659
- }
660
- echo '</select>';
661
- echo '</div>';
662
-
663
- echo '<div id="taxonomy-extended">';
664
- echo '<div class="inner border-top" id="tax-terms">';
665
- echo '<label class="full">'. __('Taxonomy Terms:', 'ajax-load-more') .'</label>';
666
- echo '<div id="tax-terms-container" class="checkboxes"></div>';
667
- echo '</div>';
668
-
669
- echo '<div class="inner border-top" id="tax-operator-select">';
670
- echo '<label class="full">'. __('Taxonomy Operator:', 'ajax-load-more') .'</label>';
671
- echo '<ul class="radio">';
672
- echo '<li><input class="alm_element" name="tax-operator" id="tax-in-radio" value="IN" type="radio" checked="checked"><label for="tax-in-radio">IN (default)</li>';
673
- echo '<li><input class="alm_element" name="tax-operator" id="tax-not-in-radio" value="NOT IN" type="radio"><label for="tax-not-in-radio">NOT IN</li>';
674
- echo '</ul>';
675
- echo '</div>';
676
- echo '</div>';
677
-
678
- echo '</div>';
679
- echo '</div>';
680
- echo '</div>';
681
- }?>
682
 
683
 
684
  <!-- Date -->
@@ -717,14 +696,15 @@
717
  <p><?php _e('Query for <a href="http://codex.wordpress.org/Class_Reference/WP_Meta_Query" target="_blank">custom field</a> by entering a custom field key, value and operator.', 'ajax-load-more'); ?></p>
718
  </div>
719
  <div class="wrap full">
720
-
721
- <div class="meta-query-wrap">
722
- <?php include( ALM_PATH . 'admin/shortcode-builder/includes/meta-query-options.php'); ?>
 
723
  </div>
724
  <div id="meta-query-relation">
725
  <div class="inner border-top highlighted">
726
- <div class="wrap-30">
727
- <label for="meta-relation" class="full"><?php _e('Relation:', 'ajax-load-more'); ?></label>
728
  <select class="alm_element meta-relation" name="meta-relation">
729
  <option value="AND" selected="selected">AND</option>
730
  <option value="OR">OR</option>
@@ -732,11 +712,12 @@
732
  </div>
733
  </div>
734
  </div>
 
735
  <div id="meta-query-extended">
736
 
737
  </div>
738
 
739
- <div class="inner border-top controls">
740
  <button class="button button-primary" id="add-meta-query"><?php _e('Add Another', 'ajax-load-more'); ?></button>
741
  </div>
742
 
363
  </div>
364
  </div>
365
 
366
+
367
  <div class="clear"></div>
368
  <hr>
369
  <div class="section-title">
642
  );
643
  $tax_output = 'objects';
644
  $taxonomies = get_taxonomies( $tax_args, $tax_output );
645
+ if ( $taxonomies ) { ?>
646
+ <div class="row taxonomy" id="alm-taxonomy">
647
+ <h3 class="heading"><?php _e('Taxonomy', 'ajax-load-more'); ?></h3>
648
+ <div class="expand-wrap">
649
+ <div class="section-title">
650
+ <p><?php _e('Select a taxonomy then select the terms and an operator.', 'ajax-load-more'); ?></p>
651
+ </div>
652
+ <div class="wrap">
653
+ <?php include( ALM_PATH . 'admin/shortcode-builder/includes/tax-query-options.php'); ?>
654
+ <div class="controls">
655
+ <button id="add-tax-query" class="button button-primary">Add Another</button>
656
+ </div>
657
+ </div>
658
+ </div>
659
+ </div>
660
+ <?php }?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
 
662
 
663
  <!-- Date -->
696
  <p><?php _e('Query for <a href="http://codex.wordpress.org/Class_Reference/WP_Meta_Query" target="_blank">custom field</a> by entering a custom field key, value and operator.', 'ajax-load-more'); ?></p>
697
  </div>
698
  <div class="wrap full">
699
+ <div class="meta-query-wrap-first">
700
+ <div class="meta-query-wrap">
701
+ <?php include( ALM_PATH . 'admin/shortcode-builder/includes/meta-query-options.php'); ?>
702
+ </div>
703
  </div>
704
  <div id="meta-query-relation">
705
  <div class="inner border-top highlighted">
706
+ <div class="wrap-30 wrap-50">
707
+ <label for="meta-relation" class="full"><?php _e('Relation:', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('The logical relationship between each custom field when there is more than one.','ajax-load-more'); ?>"></a></label>
708
  <select class="alm_element meta-relation" name="meta-relation">
709
  <option value="AND" selected="selected">AND</option>
710
  <option value="OR">OR</option>
712
  </div>
713
  </div>
714
  </div>
715
+
716
  <div id="meta-query-extended">
717
 
718
  </div>
719
 
720
+ <div class="controls">
721
  <button class="button button-primary" id="add-meta-query"><?php _e('Add Another', 'ajax-load-more'); ?></button>
722
  </div>
723
 
ajax-load-more.php CHANGED
@@ -7,14 +7,14 @@ Text Domain: ajax-load-more
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
- Version: 2.8.4
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
- define('ALM_VERSION', '2.8.4');
17
- define('ALM_RELEASE', 'December 4, 2015');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
  if (!defined('ALM_CACHE_ITEM_NAME'))
@@ -292,6 +292,7 @@ if( !class_exists('AjaxLoadMore') ):
292
  'taxonomy' => '',
293
  'taxonomy_terms' => '',
294
  'taxonomy_operator' => '',
 
295
  'meta_key' => '',
296
  'meta_value' => '',
297
  'meta_compare' => '',
@@ -307,6 +308,7 @@ if( !class_exists('AjaxLoadMore') ):
307
  'order' => 'DESC',
308
  'orderby' => 'date',
309
  'post__in' => '',
 
310
  'exclude' => '',
311
  'offset' => '0',
312
  'posts_per_page' => '5',
@@ -465,6 +467,7 @@ if( !class_exists('AjaxLoadMore') ):
465
  'taxonomy' => $taxonomy,
466
  'taxonomy_terms' => $taxonomy_terms,
467
  'taxonomy_operator' => $taxonomy_operator,
 
468
  'meta_key' => $meta_key,
469
  'meta_value' => $meta_value,
470
  'meta_compare' => $meta_compare,
@@ -475,6 +478,7 @@ if( !class_exists('AjaxLoadMore') ):
475
  'day' => $day,
476
  'author' => $author,
477
  'post__in' => $post__in,
 
478
  'search' => $search,
479
  'custom_args' => $custom_args,
480
  'post_status' => $post_status,
@@ -496,6 +500,8 @@ if( !class_exists('AjaxLoadMore') ):
496
  $alm_preload_query = new WP_Query($args);
497
  $alm_total_posts = $alm_preload_query->found_posts - $offset;
498
  $output = '';
 
 
499
  if ($alm_preload_query->have_posts()) :
500
  $alm_loop_count = 0; // Count var
501
  $alm_page = 0; // Set page to 0
@@ -514,7 +520,7 @@ if( !class_exists('AjaxLoadMore') ):
514
 
515
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
516
  // Create noscript paging for SEO if preload and seo are enabled
517
- $noscript_paging = alm_paging_no_script($alm_preload_query);
518
  }
519
 
520
  endif;
@@ -523,7 +529,7 @@ if( !class_exists('AjaxLoadMore') ):
523
  $preloaded_output .= '</'.$container_element.'>';
524
 
525
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
526
- $preloaded_output .= $noscript_paging;
527
  }
528
 
529
  $ajaxloadmore .= $preloaded_output; // Add $preloaded_output data to $ajaxloadmore
@@ -621,6 +627,7 @@ if( !class_exists('AjaxLoadMore') ):
621
  $ajaxloadmore .= ' data-taxonomy="'.$taxonomy.'"';
622
  $ajaxloadmore .= ' data-taxonomy-terms="'.$taxonomy_terms.'"';
623
  $ajaxloadmore .= ' data-taxonomy-operator="'.$taxonomy_operator.'"';
 
624
  $ajaxloadmore .= ' data-meta-key="'.$meta_key.'"';
625
  $ajaxloadmore .= ' data-meta-value="'.$meta_value.'"';
626
  $ajaxloadmore .= ' data-meta-compare="'.$meta_compare.'"';
@@ -631,6 +638,7 @@ if( !class_exists('AjaxLoadMore') ):
631
  $ajaxloadmore .= ' data-day="'.$day.'"';
632
  $ajaxloadmore .= ' data-author="'.$author.'"';
633
  $ajaxloadmore .= ' data-post-in="'.$post__in.'"';
 
634
  $ajaxloadmore .= ' data-exclude="'.$exclude.'"';
635
  $ajaxloadmore .= ' data-search="'.$search.'"';
636
  $ajaxloadmore .= ' data-custom-args="'.$custom_args.'"';
@@ -735,7 +743,9 @@ if( !class_exists('AjaxLoadMore') ):
735
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
736
  $taxonomy_terms = (isset($_GET['taxonomy_terms'])) ? $_GET['taxonomy_terms'] : '';
737
  $taxonomy_operator = $_GET['taxonomy_operator'];
738
- if(empty($taxonomy_operator)) $taxonomy_operator = 'IN';
 
 
739
 
740
  // Date
741
  $year = (isset($_GET['year'])) ? $_GET['year'] : '';
@@ -746,7 +756,9 @@ if( !class_exists('AjaxLoadMore') ):
746
  $meta_key = (isset($_GET['meta_key'])) ? $_GET['meta_key'] : '';
747
  $meta_value = (isset($_GET['meta_value'])) ? $_GET['meta_value'] : '';
748
  $meta_compare = $_GET['meta_compare'];
749
- if($meta_compare == '') $meta_compare = 'IN';
 
 
750
  $meta_relation = $_GET['meta_relation'];
751
  if($meta_relation == '') $meta_relation = 'AND';
752
  $meta_type = $_GET['meta_type'];
@@ -761,7 +773,8 @@ if( !class_exists('AjaxLoadMore') ):
761
  $orderby = (isset($_GET['orderby'])) ? $_GET['orderby'] : 'date';
762
 
763
  // Include, Exclude, Offset, Status
764
- $post__in = (isset($_GET['post__in'])) ? $_GET['post__in'] : '';
 
765
  $exclude = (isset($_GET['exclude'])) ? $_GET['exclude'] : '';
766
  $offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
767
  $post_status = $_GET['post_status'];
@@ -803,12 +816,54 @@ if( !class_exists('AjaxLoadMore') ):
803
  'paged' => $paged,
804
  );
805
 
806
- // Post Format & taxonomy
807
- if(!empty($post_format) || !empty($taxonomy)){
808
- $args['tax_query'] = array(
809
- 'relation' => 'AND',
810
- alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_operator)
811
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  }
813
 
814
  // Category
@@ -848,25 +903,25 @@ if( !class_exists('AjaxLoadMore') ):
848
  if(!empty($meta_key) && !empty($meta_value)){
849
 
850
  // Parse multiple meta query
851
- $total = count(explode(":", $meta_key)); // Total meta_query objects
852
  $meta_keys = explode(":", $meta_key); // convert to array
853
  $meta_value = explode(":", $meta_value); // convert to array
854
  $meta_compare = explode(":", $meta_compare); // convert to array
855
  $meta_type = explode(":", $meta_type); // convert to array
856
 
857
- if($total == 1){
858
  $args['meta_query'] = array(
859
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
860
  );
861
  }
862
- if($total == 2){
863
  $args['meta_query'] = array(
864
  'relation' => $meta_relation,
865
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
866
  alm_get_meta_query($meta_keys[1], $meta_value[1], $meta_compare[1], $meta_type[1]),
867
  );
868
  }
869
- if($total == 3){
870
  $args['meta_query'] = array(
871
  'relation' => $meta_relation,
872
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
@@ -874,7 +929,7 @@ if( !class_exists('AjaxLoadMore') ):
874
  alm_get_meta_query($meta_keys[2], $meta_value[2], $meta_compare[2], $meta_type[2]),
875
  );
876
  }
877
- if($total == 4){
878
  $args['meta_query'] = array(
879
  'relation' => $meta_relation,
880
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
@@ -904,7 +959,11 @@ if( !class_exists('AjaxLoadMore') ):
904
  }
905
 
906
  // Exclude posts
907
- if(!empty($exclude)){
 
 
 
 
908
  $exclude = explode(",",$exclude);
909
  $args['post__not_in'] = $exclude;
910
  }
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
+ Version: 2.8.5
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
+ define('ALM_VERSION', '2.8.5');
17
+ define('ALM_RELEASE', 'December 22, 2015');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
  if (!defined('ALM_CACHE_ITEM_NAME'))
292
  'taxonomy' => '',
293
  'taxonomy_terms' => '',
294
  'taxonomy_operator' => '',
295
+ 'taxonomy_relation' => '',
296
  'meta_key' => '',
297
  'meta_value' => '',
298
  'meta_compare' => '',
308
  'order' => 'DESC',
309
  'orderby' => 'date',
310
  'post__in' => '',
311
+ 'post__not_in' => '',
312
  'exclude' => '',
313
  'offset' => '0',
314
  'posts_per_page' => '5',
467
  'taxonomy' => $taxonomy,
468
  'taxonomy_terms' => $taxonomy_terms,
469
  'taxonomy_operator' => $taxonomy_operator,
470
+ 'taxonomy_relation' => $taxonomy_relation,
471
  'meta_key' => $meta_key,
472
  'meta_value' => $meta_value,
473
  'meta_compare' => $meta_compare,
478
  'day' => $day,
479
  'author' => $author,
480
  'post__in' => $post__in,
481
+ 'post__not_in' => $post__not_in,
482
  'search' => $search,
483
  'custom_args' => $custom_args,
484
  'post_status' => $post_status,
500
  $alm_preload_query = new WP_Query($args);
501
  $alm_total_posts = $alm_preload_query->found_posts - $offset;
502
  $output = '';
503
+ $noscript = '';
504
+
505
  if ($alm_preload_query->have_posts()) :
506
  $alm_loop_count = 0; // Count var
507
  $alm_page = 0; // Set page to 0
520
 
521
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
522
  // Create noscript paging for SEO if preload and seo are enabled
523
+ $noscript = alm_paging_no_script($alm_preload_query);
524
  }
525
 
526
  endif;
529
  $preloaded_output .= '</'.$container_element.'>';
530
 
531
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
532
+ $preloaded_output .= $noscript;
533
  }
534
 
535
  $ajaxloadmore .= $preloaded_output; // Add $preloaded_output data to $ajaxloadmore
627
  $ajaxloadmore .= ' data-taxonomy="'.$taxonomy.'"';
628
  $ajaxloadmore .= ' data-taxonomy-terms="'.$taxonomy_terms.'"';
629
  $ajaxloadmore .= ' data-taxonomy-operator="'.$taxonomy_operator.'"';
630
+ $ajaxloadmore .= ' data-taxonomy-relation="'.$taxonomy_relation.'"';
631
  $ajaxloadmore .= ' data-meta-key="'.$meta_key.'"';
632
  $ajaxloadmore .= ' data-meta-value="'.$meta_value.'"';
633
  $ajaxloadmore .= ' data-meta-compare="'.$meta_compare.'"';
638
  $ajaxloadmore .= ' data-day="'.$day.'"';
639
  $ajaxloadmore .= ' data-author="'.$author.'"';
640
  $ajaxloadmore .= ' data-post-in="'.$post__in.'"';
641
+ $ajaxloadmore .= ' data-post-not-in="'.$post__not_in.'"';
642
  $ajaxloadmore .= ' data-exclude="'.$exclude.'"';
643
  $ajaxloadmore .= ' data-search="'.$search.'"';
644
  $ajaxloadmore .= ' data-custom-args="'.$custom_args.'"';
743
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
744
  $taxonomy_terms = (isset($_GET['taxonomy_terms'])) ? $_GET['taxonomy_terms'] : '';
745
  $taxonomy_operator = $_GET['taxonomy_operator'];
746
+ if(empty($taxonomy_operator)) $taxonomy_operator = 'IN';
747
+ $taxonomy_relation = (isset($_GET['taxonomy_relation'])) ? $_GET['taxonomy_relation'] : 'AND';
748
+ if($taxonomy_relation == '') $taxonomy_relation = 'AND';
749
 
750
  // Date
751
  $year = (isset($_GET['year'])) ? $_GET['year'] : '';
756
  $meta_key = (isset($_GET['meta_key'])) ? $_GET['meta_key'] : '';
757
  $meta_value = (isset($_GET['meta_value'])) ? $_GET['meta_value'] : '';
758
  $meta_compare = $_GET['meta_compare'];
759
+ if($meta_compare == '') $meta_compare = 'IN';
760
+ if($meta_compare === 'lessthan') $meta_compare = '<'; // do_shortcode fix (shortcode was rendering as HTML)
761
+ if($meta_compare === 'lessthanequalto') $meta_compare = '<='; // do_shortcode fix (shortcode was rendering as HTML)
762
  $meta_relation = $_GET['meta_relation'];
763
  if($meta_relation == '') $meta_relation = 'AND';
764
  $meta_type = $_GET['meta_type'];
773
  $orderby = (isset($_GET['orderby'])) ? $_GET['orderby'] : 'date';
774
 
775
  // Include, Exclude, Offset, Status
776
+ $post__in = (isset($_GET['post__in'])) ? $_GET['post__in'] : '';
777
+ $post__not_in = (isset($_GET['post__not_in'])) ? $_GET['post__not_in'] : '';
778
  $exclude = (isset($_GET['exclude'])) ? $_GET['exclude'] : '';
779
  $offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
780
  $post_status = $_GET['post_status'];
816
  'paged' => $paged,
817
  );
818
 
819
+ // Post Format & Taxonomy
820
+ // * Both use tax_query, so we need to combine these queries
821
+ if(!empty($post_format) || !empty($taxonomy)){
822
+
823
+ $tax_query_total = count(explode(":", $taxonomy)); // Total $taxonomy objects
824
+ $taxonomy = explode(":", $taxonomy); // convert to array
825
+ $taxonomy_terms = explode(":", $taxonomy_terms); // convert to array
826
+ $taxonomy_operator = explode(":", $taxonomy_operator); // convert to array
827
+
828
+ if(empty($taxonomy)){
829
+
830
+ // Post Format only
831
+ $args['tax_query'] = array(
832
+ alm_get_post_format($post_format),
833
+ );
834
+
835
+ }else{
836
+
837
+ // Taxonomy and possibly Post Formats
838
+
839
+ if($tax_query_total === 1){
840
+ $args['tax_query'] = array(
841
+ 'relation' => $taxonomy_relation,
842
+ alm_get_post_format($post_format),
843
+ alm_get_taxonomy_query($taxonomy[0], $taxonomy_terms[0], $taxonomy_operator[0]),
844
+ );
845
+ }
846
+
847
+ if($tax_query_total === 2){
848
+ $args['tax_query'] = array(
849
+ 'relation' => $taxonomy_relation,
850
+ alm_get_post_format($post_format),
851
+ alm_get_taxonomy_query($taxonomy[0], $taxonomy_terms[0], $taxonomy_operator[0]),
852
+ alm_get_taxonomy_query($taxonomy[1], $taxonomy_terms[1], $taxonomy_operator[1]),
853
+ );
854
+ }
855
+
856
+ if($tax_query_total === 3){
857
+ $args['tax_query'] = array(
858
+ 'relation' => $taxonomy_relation,
859
+ alm_get_post_format($post_format),
860
+ alm_get_taxonomy_query($taxonomy[0], $taxonomy_terms[0], $taxonomy_operator[0]),
861
+ alm_get_taxonomy_query($taxonomy[1], $taxonomy_terms[1], $taxonomy_operator[1]),
862
+ alm_get_taxonomy_query($taxonomy[2], $taxonomy_terms[2], $taxonomy_operator[2]),
863
+ );
864
+ }
865
+ }
866
+
867
  }
868
 
869
  // Category
903
  if(!empty($meta_key) && !empty($meta_value)){
904
 
905
  // Parse multiple meta query
906
+ $meta_query_total = count(explode(":", $meta_key)); // Total meta_query objects
907
  $meta_keys = explode(":", $meta_key); // convert to array
908
  $meta_value = explode(":", $meta_value); // convert to array
909
  $meta_compare = explode(":", $meta_compare); // convert to array
910
  $meta_type = explode(":", $meta_type); // convert to array
911
 
912
+ if($meta_query_total == 1){
913
  $args['meta_query'] = array(
914
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
915
  );
916
  }
917
+ if($meta_query_total == 2){
918
  $args['meta_query'] = array(
919
  'relation' => $meta_relation,
920
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
921
  alm_get_meta_query($meta_keys[1], $meta_value[1], $meta_compare[1], $meta_type[1]),
922
  );
923
  }
924
+ if($meta_query_total == 3){
925
  $args['meta_query'] = array(
926
  'relation' => $meta_relation,
927
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
929
  alm_get_meta_query($meta_keys[2], $meta_value[2], $meta_compare[2], $meta_type[2]),
930
  );
931
  }
932
+ if($meta_query_total == 4){
933
  $args['meta_query'] = array(
934
  'relation' => $meta_relation,
935
  alm_get_meta_query($meta_keys[0], $meta_value[0], $meta_compare[0], $meta_type[0]),
959
  }
960
 
961
  // Exclude posts
962
+ if(!empty($post__not_in)){
963
+ $post__not_in = explode(",",$post__not_in);
964
+ $args['post__not_in'] = $post__not_in;
965
+ }
966
+ if(!empty($exclude)){ // Deprecate this soon - 2.8.5 */
967
  $exclude = explode(",",$exclude);
968
  $args['post__not_in'] = $exclude;
969
  }
core/functions.php CHANGED
@@ -58,12 +58,38 @@ function alm_get_current_repeater($repeater, $type) {
58
 
59
  function alm_get_default_repeater() {
60
  global $wpdb;
61
- $blog_id = $wpdb->blogid;
 
62
 
63
- if($blog_id > 1){
64
- $file = ALM_PATH. 'core/repeater/'. $blog_id .'/default.php'; // File
65
- }else{
66
- $file = ALM_PATH. 'core/repeater/default.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
 
69
  return $file;
@@ -71,12 +97,36 @@ function alm_get_default_repeater() {
71
 
72
 
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  /*
75
  * alm_get_post_format
76
  * Query by post format
77
  *
78
  * @return $args = array();
79
  * @since 2.5.0
 
80
  */
81
  function alm_get_post_format($post_format){
82
  if(!empty($post_format)){
@@ -89,43 +139,61 @@ function alm_get_post_format($post_format){
89
  $terms[] = 'post-format-'.$format;
90
  }
91
  }
92
- $args = array(
93
  'taxonomy' => 'post_format',
94
  'terms' => $terms,
95
  'field' => 'slug',
96
  'operator' => 'NOT IN',
97
  );
98
  }else{
99
- $args = array(
100
  'taxonomy' => 'post_format',
101
  'field' => 'slug',
102
  'terms' => array($format),
103
  );
104
  }
105
- return $args;
106
  }
107
  }
108
 
109
 
110
 
111
  /*
112
- * alm_get_taxonomy
113
- * Query by custom taxonomy values
114
  *
115
  * @return $args = array();
116
- * @since 2.5.0
117
  */
118
- function alm_get_taxonomy($taxonomy, $taxonomy_terms, $taxonomy_operator){
119
- if(!empty($taxonomy) && !empty($taxonomy_terms) && !empty($taxonomy_operator)){
120
- $the_terms = explode(",", $taxonomy_terms);
121
- $args = array(
122
- 'taxonomy' => $taxonomy,
123
- 'field' => 'slug',
124
- 'terms' => $the_terms,
125
- 'operator' => $taxonomy_operator,
126
- );
127
- return $args;
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
 
131
 
@@ -136,6 +204,8 @@ function alm_get_taxonomy($taxonomy, $taxonomy_terms, $taxonomy_operator){
136
  *
137
  * @return $args = array();
138
  * @since 2.5.0
 
 
139
  */
140
  function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_operator){
141
 
@@ -154,6 +224,7 @@ function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_o
154
  // Post Format [ONLY]
155
  if(!empty($post_format) && empty($taxonomy)){
156
  $format = "post-format-$post_format";
 
157
  //If query is for standard then we need to filter by NOT IN
158
  if($format == 'post-format-standard'){
159
  if (($post_formats = get_theme_support('post-formats')) && is_array($post_formats[0]) && count($post_formats[0])) {
@@ -226,8 +297,13 @@ function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_o
226
  function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
227
  if(!empty($meta_key) && !empty($meta_value)){
228
 
229
- $meta_values = alm_parse_meta_value($meta_value, $meta_compare);
230
- $return = array('key' => $meta_key,'value' => $meta_values,'compare' => $meta_compare,'type' => $meta_type);
 
 
 
 
 
231
 
232
  return $return;
233
 
@@ -241,6 +317,7 @@ function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
241
  * alm_parse_meta_value
242
  * Parse the meta value for multiple vals
243
  *
 
244
  * @return array;
245
  * @since 2.6.4
246
  */
58
 
59
  function alm_get_default_repeater() {
60
  global $wpdb;
61
+ $file = null;
62
+ $template_dir = 'alm_templates';
63
 
64
+
65
+ // Allow user to load template from theme directory
66
+ // Since 2.8.5
67
+
68
+ // load repeater template from current theme folder
69
+ if(is_child_theme()){
70
+ $template_theme_file = get_stylesheet_directory().'/'. $template_dir .'/default.php';
71
+ // if child theme does not have repeater template, then use the parent theme dir
72
+ if(!file_exists($template_theme_file)){
73
+ $template_theme_file = get_template_directory().'/'. $template_dir .'/default.php';
74
+ }
75
+ }
76
+ else{
77
+ $template_theme_file = get_template_directory().'/'. $template_dir .'/default.php';
78
+ }
79
+ // if theme or child theme contains the template, use that file
80
+ if(file_exists($template_theme_file)){
81
+ $file = $template_theme_file;
82
+ }
83
+
84
+ // Since 2.0
85
+ // otherwise use pre-defined plug-in templates
86
+ if($file == null){
87
+ $blog_id = $wpdb->blogid;
88
+ if($blog_id > 1){
89
+ $file = ALM_PATH. 'core/repeater/'. $blog_id .'/default.php'; // File
90
+ }else{
91
+ $file = ALM_PATH. 'core/repeater/default.php';
92
+ }
93
  }
94
 
95
  return $file;
97
 
98
 
99
 
100
+ /*
101
+ * alm_get_taxonomy
102
+ * Query by custom taxonomy values
103
+ *
104
+ * @return $args = array();
105
+ * @since 2.5.0
106
+ *
107
+ * @deprecated in 2.5.0
108
+ */
109
+ function alm_get_taxonomy($taxonomy, $taxonomy_terms, $taxonomy_operator){
110
+ if(!empty($taxonomy) && !empty($taxonomy_terms) && !empty($taxonomy_operator)){
111
+ $the_terms = explode(",", $taxonomy_terms);
112
+ $args = array(
113
+ 'taxonomy' => $taxonomy,
114
+ 'field' => 'slug',
115
+ 'terms' => $the_terms,
116
+ 'operator' => $taxonomy_operator,
117
+ );
118
+ return $args;
119
+ }
120
+ }
121
+
122
+
123
  /*
124
  * alm_get_post_format
125
  * Query by post format
126
  *
127
  * @return $args = array();
128
  * @since 2.5.0
129
+ * @updated 2.8.5
130
  */
131
  function alm_get_post_format($post_format){
132
  if(!empty($post_format)){
139
  $terms[] = 'post-format-'.$format;
140
  }
141
  }
142
+ $return = array(
143
  'taxonomy' => 'post_format',
144
  'terms' => $terms,
145
  'field' => 'slug',
146
  'operator' => 'NOT IN',
147
  );
148
  }else{
149
+ $return = array(
150
  'taxonomy' => 'post_format',
151
  'field' => 'slug',
152
  'terms' => array($format),
153
  );
154
  }
155
+ return $return;
156
  }
157
  }
158
 
159
 
160
 
161
  /*
162
+ * alm_get_taxonomy_query
163
+ * Query for custom taxonomy
164
  *
165
  * @return $args = array();
166
+ * @since 2.8.5
167
  */
168
+ function alm_get_taxonomy_query($taxonomy, $taxonomy_terms, $taxonomy_operator){
169
+ if(!empty($taxonomy) && !empty($taxonomy_terms)){
170
+ $taxonomy_term_values = alm_parse_tax_terms($taxonomy_terms);
171
+ $return = array(
172
+ 'taxonomy' => $taxonomy,
173
+ 'field' => 'slug',
174
+ 'terms' => $taxonomy_term_values,
175
+ 'operator' => $taxonomy_operator
176
+ );
177
+ return $return;
178
+ }
179
+ }
180
+
181
+
182
+
183
+ /*
184
+ * alm_parse_tax_terms
185
+ * Parse the taxonomy terms for multiple vals
186
+ *
187
+ * @helper function @alm_get_taxonomy_query()
188
+ * @return array;
189
+ * @since 2.8.5
190
+ */
191
+ function alm_parse_tax_terms($taxonomy_terms){
192
+ // Remove all whitespace for $taxonomy_terms because it needs to be an exact match
193
+ $taxonomy_terms = preg_replace('/\s+/', ' ', $taxonomy_terms); // Trim whitespace
194
+ $taxonomy_terms = str_replace(', ', ',', $taxonomy_terms); // Replace [term, term] with [term,term]
195
+ $taxonomy_terms = explode(",", $taxonomy_terms);
196
+ return $taxonomy_terms;
197
  }
198
 
199
 
204
  *
205
  * @return $args = array();
206
  * @since 2.5.0
207
+
208
+ * @deprecated in 2.8.5
209
  */
210
  function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_operator){
211
 
224
  // Post Format [ONLY]
225
  if(!empty($post_format) && empty($taxonomy)){
226
  $format = "post-format-$post_format";
227
+
228
  //If query is for standard then we need to filter by NOT IN
229
  if($format == 'post-format-standard'){
230
  if (($post_formats = get_theme_support('post-formats')) && is_array($post_formats[0]) && count($post_formats[0])) {
297
  function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
298
  if(!empty($meta_key) && !empty($meta_value)){
299
 
300
+ $meta_values = alm_parse_meta_value($meta_value, $meta_compare);
301
+ $return = array(
302
+ 'key' => $meta_key,
303
+ 'value' => $meta_values,
304
+ 'compare' => $meta_compare,
305
+ 'type' => $meta_type
306
+ );
307
 
308
  return $return;
309
 
317
  * alm_parse_meta_value
318
  * Parse the meta value for multiple vals
319
  *
320
+ * @helper function @alm_get_meta_query()
321
  * @return array;
322
  * @since 2.6.4
323
  */
core/js/ajax-load-more.js CHANGED
@@ -420,6 +420,7 @@
420
  taxonomy: alm.content.attr('data-taxonomy'),
421
  taxonomy_terms: alm.content.attr('data-taxonomy-terms'),
422
  taxonomy_operator: alm.content.attr('data-taxonomy-operator'),
 
423
  meta_key: alm.content.attr('data-meta-key'),
424
  meta_value: alm.content.attr('data-meta-value'),
425
  meta_compare: alm.content.attr('data-meta-compare'),
@@ -433,7 +434,8 @@
433
  order: alm.content.attr('data-order'),
434
  orderby: alm.content.attr('data-orderby'),
435
  post__in: alm.content.attr('data-post-in'),
436
- exclude: alm.content.attr('data-exclude'),
 
437
  search: alm.content.attr('data-search'),
438
  custom_args: alm.content.attr('data-custom-args'),
439
  posts_per_page: alm.posts_per_page,
420
  taxonomy: alm.content.attr('data-taxonomy'),
421
  taxonomy_terms: alm.content.attr('data-taxonomy-terms'),
422
  taxonomy_operator: alm.content.attr('data-taxonomy-operator'),
423
+ taxonomy_relation: alm.content.attr('data-taxonomy-relation'),
424
  meta_key: alm.content.attr('data-meta-key'),
425
  meta_value: alm.content.attr('data-meta-value'),
426
  meta_compare: alm.content.attr('data-meta-compare'),
434
  order: alm.content.attr('data-order'),
435
  orderby: alm.content.attr('data-orderby'),
436
  post__in: alm.content.attr('data-post-in'),
437
+ post__not_in: alm.content.attr('data-post-not-in'),
438
+ exclude: alm.content.attr('data-exclude'), // Deprecate soon in favor of post__not_in
439
  search: alm.content.attr('data-search'),
440
  custom_args: alm.content.attr('data-custom-args'),
441
  posts_per_page: alm.posts_per_page,
core/js/ajax-load-more.min.js CHANGED
@@ -47,7 +47,7 @@ alm.post_type=alm.content.attr('data-post-type');alm.post_type=alm.post_type.spl
47
  alm.AjaxLoadMore.loadPosts=function(){if(!alm.disable_ajax){if(!alm.paging){alm.button.addClass('loading');if(alm.button_loading_label!==false){alm.button.text(alm.button_loading_label);}}
48
  alm.loading=true;if(alm.cache==='true'&&!alm.cache_logged_in){if(alm.init&&alm.seo&&alm.isPaged){alm.AjaxLoadMore.ajax('standard');}else{var cachePage=alm.cache_path+'/page-'+alm.page+'.html';$.get(cachePage,function(data){alm.AjaxLoadMore.success(data);}).fail(function(){alm.AjaxLoadMore.ajax('standard');});}}else{alm.AjaxLoadMore.ajax('standard');}}};alm.AjaxLoadMore.ajax=function(queryType){if(alm.previous_post){alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');}
49
  var action='alm_query_posts';if(alm.comments==='true'){action='alm_comments_query';alm.posts_per_page=alm.comments_per_page;alm.comments_array={'comments':'true','post_id':alm.comments_post_id,'per_page':alm.comments_per_page,'type':alm.comments_type,'style':alm.comments_style,'template':alm.comments_template,'callback':alm.comments_callback,};}
50
- $.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:action,query_type:queryType,nonce:alm_localize.alm_nonce,cache_id:alm.cache_id,repeater:alm.repeater,theme_repeater:alm.theme_repeater,comments:alm.comments_array,post_type:alm.post_type,post_format:alm.content.attr('data-post-format'),category:alm.content.attr('data-category'),category__not_in:alm.content.attr('data-category-not-in'),tag:alm.content.attr('data-tag'),tag__not_in:alm.content.attr('data-tag-not-in'),taxonomy:alm.content.attr('data-taxonomy'),taxonomy_terms:alm.content.attr('data-taxonomy-terms'),taxonomy_operator:alm.content.attr('data-taxonomy-operator'),meta_key:alm.content.attr('data-meta-key'),meta_value:alm.content.attr('data-meta-value'),meta_compare:alm.content.attr('data-meta-compare'),meta_relation:alm.content.attr('data-meta-relation'),meta_type:alm.content.attr('data-meta-type'),author:alm.content.attr('data-author'),year:alm.content.attr('data-year'),month:alm.content.attr('data-month'),day:alm.content.attr('data-day'),post_status:alm.content.attr('data-post-status'),order:alm.content.attr('data-order'),orderby:alm.content.attr('data-orderby'),post__in:alm.content.attr('data-post-in'),exclude:alm.content.attr('data-exclude'),search:alm.content.attr('data-search'),custom_args:alm.content.attr('data-custom-args'),posts_per_page:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,preloaded:alm.preloaded,preloaded_amount:alm.preloaded_amount,seo_start_page:alm.start_page,previous_post:alm.previous_post,previous_post_id:alm.previous_post_id,previous_post_taxonomy:alm.previous_post_taxonomy,lang:alm.lang},dataType:"html",beforeSend:function(){if(alm.page!=1&&!alm.paging){alm.button.addClass('loading');}},success:function(data){if(queryType==='standard'){alm.AjaxLoadMore.success(data);}
51
  else if(queryType==='totalposts'&&alm.paging){if($.isFunction($.fn.almBuildPagination)){$.fn.almBuildPagination(data,alm);}}},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);}});};if(alm.paging){alm.AjaxLoadMore.ajax('totalposts');}
52
  alm.AjaxLoadMore.success=function(data){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
53
  alm.data=$(data);if(alm.init){if(!alm.paging){alm.button.text(alm.button_label);}else{if(alm.data.length>0){alm.el=$('<div class="alm-reveal"/>');alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');$('.alm-paging-content',alm.el).append(alm.data).hide();alm.content.append(alm.el);alm.content.parent().removeClass('loading');alm.resetBtnText();$('.alm-paging-content',alm.el).fadeIn(alm.speed,'alm_easeInOutQuad',function(){var paddingT=parseInt(alm.content.css('padding-top')),paddingB=parseInt(alm.content.css('padding-bottom'));alm.content.css('height',alm.el.height()+paddingT+paddingB+'px');if($.isFunction($.fn.almFadePageControls)){$.fn.almFadePageControls(alm.btnWrap);}});}}
47
  alm.AjaxLoadMore.loadPosts=function(){if(!alm.disable_ajax){if(!alm.paging){alm.button.addClass('loading');if(alm.button_loading_label!==false){alm.button.text(alm.button_loading_label);}}
48
  alm.loading=true;if(alm.cache==='true'&&!alm.cache_logged_in){if(alm.init&&alm.seo&&alm.isPaged){alm.AjaxLoadMore.ajax('standard');}else{var cachePage=alm.cache_path+'/page-'+alm.page+'.html';$.get(cachePage,function(data){alm.AjaxLoadMore.success(data);}).fail(function(){alm.AjaxLoadMore.ajax('standard');});}}else{alm.AjaxLoadMore.ajax('standard');}}};alm.AjaxLoadMore.ajax=function(queryType){if(alm.previous_post){alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');}
49
  var action='alm_query_posts';if(alm.comments==='true'){action='alm_comments_query';alm.posts_per_page=alm.comments_per_page;alm.comments_array={'comments':'true','post_id':alm.comments_post_id,'per_page':alm.comments_per_page,'type':alm.comments_type,'style':alm.comments_style,'template':alm.comments_template,'callback':alm.comments_callback,};}
50
+ $.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:action,query_type:queryType,nonce:alm_localize.alm_nonce,cache_id:alm.cache_id,repeater:alm.repeater,theme_repeater:alm.theme_repeater,comments:alm.comments_array,post_type:alm.post_type,post_format:alm.content.attr('data-post-format'),category:alm.content.attr('data-category'),category__not_in:alm.content.attr('data-category-not-in'),tag:alm.content.attr('data-tag'),tag__not_in:alm.content.attr('data-tag-not-in'),taxonomy:alm.content.attr('data-taxonomy'),taxonomy_terms:alm.content.attr('data-taxonomy-terms'),taxonomy_operator:alm.content.attr('data-taxonomy-operator'),taxonomy_relation:alm.content.attr('data-taxonomy-relation'),meta_key:alm.content.attr('data-meta-key'),meta_value:alm.content.attr('data-meta-value'),meta_compare:alm.content.attr('data-meta-compare'),meta_relation:alm.content.attr('data-meta-relation'),meta_type:alm.content.attr('data-meta-type'),author:alm.content.attr('data-author'),year:alm.content.attr('data-year'),month:alm.content.attr('data-month'),day:alm.content.attr('data-day'),post_status:alm.content.attr('data-post-status'),order:alm.content.attr('data-order'),orderby:alm.content.attr('data-orderby'),post__in:alm.content.attr('data-post-in'),post__not_in:alm.content.attr('data-post-not-in'),exclude:alm.content.attr('data-exclude'),search:alm.content.attr('data-search'),custom_args:alm.content.attr('data-custom-args'),posts_per_page:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,preloaded:alm.preloaded,preloaded_amount:alm.preloaded_amount,seo_start_page:alm.start_page,previous_post:alm.previous_post,previous_post_id:alm.previous_post_id,previous_post_taxonomy:alm.previous_post_taxonomy,lang:alm.lang},dataType:"html",beforeSend:function(){if(alm.page!=1&&!alm.paging){alm.button.addClass('loading');}},success:function(data){if(queryType==='standard'){alm.AjaxLoadMore.success(data);}
51
  else if(queryType==='totalposts'&&alm.paging){if($.isFunction($.fn.almBuildPagination)){$.fn.almBuildPagination(data,alm);}}},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);}});};if(alm.paging){alm.AjaxLoadMore.ajax('totalposts');}
52
  alm.AjaxLoadMore.success=function(data){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
53
  alm.data=$(data);if(alm.init){if(!alm.paging){alm.button.text(alm.button_label);}else{if(alm.data.length>0){alm.el=$('<div class="alm-reveal"/>');alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');$('.alm-paging-content',alm.el).append(alm.data).hide();alm.content.append(alm.el);alm.content.parent().removeClass('loading');alm.resetBtnText();$('.alm-paging-content',alm.el).fadeIn(alm.speed,'alm_easeInOutQuad',function(){var paddingT=parseInt(alm.content.css('padding-top')),paddingB=parseInt(alm.content.css('padding-bottom'));alm.content.css('height',alm.el.height()+paddingT+paddingB+'px');if($.isFunction($.fn.almFadePageControls)){$.fn.almFadePageControls(alm.btnWrap);}});}}
lang/ajax-load-more.pot CHANGED
@@ -1,38 +1,38 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ajax Load More\n"
4
- "POT-Creation-Date: 2015-12-04 12:45-0500\n"
5
- "PO-Revision-Date: 2015-12-04 12:45-0500\n"
6
  "Last-Translator: Darren Cooney <dcooney@ecentricarts.com>\n"
7
  "Language-Team: \n"
8
  "Language: en_CA\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.7\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
  #: ../admin/admin.php:112 ../admin/admin.php:651 ../admin/admin.php:695
19
- #: ../admin/admin.php:741
20
  msgid "You don't belong here."
21
  msgstr ""
22
 
23
- #: ../admin/admin.php:155 ../admin/views/licenses.php:50
24
- #: ../admin/views/licenses.php:104 ../admin/views/licenses.php:159
25
- #: ../admin/views/licenses.php:215 ../admin/views/licenses.php:269
26
- #: ../admin/views/licenses.php:322 ../admin/views/licenses.php:377
27
- #: ../admin/views/licenses.php:434
28
  msgid "Active"
29
  msgstr ""
30
 
31
- #: ../admin/admin.php:156 ../admin/views/licenses.php:54
32
- #: ../admin/views/licenses.php:108 ../admin/views/licenses.php:163
33
- #: ../admin/views/licenses.php:219 ../admin/views/licenses.php:273
34
- #: ../admin/views/licenses.php:326 ../admin/views/licenses.php:381
35
- #: ../admin/views/licenses.php:438
36
  msgid "Inactive"
37
  msgstr ""
38
 
@@ -62,139 +62,139 @@ msgstr ""
62
  msgid "Error Writing File"
63
  msgstr ""
64
 
65
- #: ../admin/admin.php:803
66
- #: ../admin/shortcode-builder/shortcode-builder.php:1122
67
  msgid "Container Type"
68
  msgstr ""
69
 
70
- #: ../admin/admin.php:811
71
- #: ../admin/shortcode-builder/shortcode-builder.php:1142
72
  msgid "Container Classes"
73
  msgstr ""
74
 
75
- #: ../admin/admin.php:819
76
  msgid "Disable CSS"
77
  msgstr ""
78
 
79
- #: ../admin/admin.php:827
80
  msgid "Button/Loading Style"
81
  msgstr ""
82
 
83
- #: ../admin/admin.php:835
84
  msgid "Button Classes"
85
  msgstr ""
86
 
87
- #: ../admin/admin.php:843
88
  msgid "Ajax Security"
89
  msgstr ""
90
 
91
- #: ../admin/admin.php:851
92
  msgid "Top of Page"
93
  msgstr ""
94
 
95
- #: ../admin/admin.php:859
96
  msgid "Dynamic Content"
97
  msgstr ""
98
 
99
- #: ../admin/admin.php:867
100
  msgid "Editor Button"
101
  msgstr ""
102
 
103
- #: ../admin/admin.php:875
104
  msgid "Error Notices"
105
  msgstr ""
106
 
107
- #: ../admin/admin.php:940
108
  msgid ""
109
  "Customize the user experience of Ajax Load More by updating the fields below."
110
  msgstr ""
111
 
112
- #: ../admin/admin.php:953
113
  msgid "The following settings affect the WordPress admin area only."
114
  msgstr ""
115
 
116
- #: ../admin/admin.php:984
117
  msgid "I want to use my own CSS styles."
118
  msgstr ""
119
 
120
- #: ../admin/admin.php:984
121
  msgid "View Ajax Load More CSS"
122
  msgstr ""
123
 
124
- #: ../admin/admin.php:1004
125
  msgid "Hide shortcode button in WYSIWYG editor."
126
  msgstr ""
127
 
128
- #: ../admin/admin.php:1025
129
  msgid ""
130
  "Display error messaging regarding repeater template updates in the browser "
131
  "console."
132
  msgstr ""
133
 
134
- #: ../admin/admin.php:1046
135
  msgid ""
136
  "Disable dynamic population of categories, tags and authors in the Shortcode "
137
  "Builder.<span style=\"display:block\">Recommended if you have an "
138
  "extraordinary number of categories, tags and/or authors."
139
  msgstr ""
140
 
141
- #: ../admin/admin.php:1067 ../admin/admin.php:1070
142
  msgid "Ajax Posts Here"
143
  msgstr ""
144
 
145
- #: ../admin/admin.php:1072
146
  msgid "You can modify the container type when building a shortcode."
147
  msgstr ""
148
 
149
- #: ../admin/admin.php:1089
150
  msgid ""
151
  "Add classes to Ajax Load More container - classes are applied globally and "
152
  "will appear with every instance of Ajax Load More. <span style=\"display:"
153
  "block\">You can also add classes when building a shortcode.</span>"
154
  msgstr ""
155
 
156
- #: ../admin/admin.php:1151
157
  msgid ""
158
  "Select an Ajax loading style - you can choose between a <strong>button</"
159
  "strong> or <strong>infinite scroll</strong>"
160
  msgstr ""
161
 
162
- #: ../admin/admin.php:1174
163
  msgid "Preview"
164
  msgstr ""
165
 
166
- #: ../admin/admin.php:1193
167
  msgid "Add classes to your <strong>Load More</strong> button"
168
  msgstr ""
169
 
170
- #: ../admin/admin.php:1236
171
  msgid ""
172
  "On initial page load, move the user's browser window to the top of the "
173
  "screen.<span style=\"display:block\">This <u>may</u> help prevent the "
174
  "loading of unnecessary posts.</span>"
175
  msgstr ""
176
 
177
- #: ../admin/admin.php:1257
178
  msgid ""
179
  "Enable <a href=\"https://codex.wordpress.org/WordPress_Nonces\" target="
180
  "\"_blank\">WP nonce</a> verification to help protect URLs against certain "
181
  "types of misuse, malicious or otherwise on each Ajax Load More query."
182
  msgstr ""
183
 
184
- #: ../admin/editor/editor-build.php:40
185
  msgid "Jump to Option"
186
  msgstr ""
187
 
188
- #: ../admin/editor/editor-build.php:44
189
  msgid ""
190
  "Create your own Ajax Load More shortcode by adjusting the parameters below:"
191
  msgstr ""
192
 
193
- #: ../admin/editor/editor-build.php:51
194
  msgid "Insert Shortcode"
195
  msgstr ""
196
 
197
- #: ../admin/editor/editor-build.php:54 ../admin/views/shortcode-builder.php:27
198
  msgid "Copy"
199
  msgstr ""
200
 
@@ -417,6 +417,41 @@ msgstr ""
417
  msgid "Type:"
418
  msgstr ""
419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  #: ../admin/shortcode-builder/shortcode-builder.php:1
421
  #: ../admin/views/examples.php:9 ../admin/views/repeater-templates.php:12
422
  msgid "Collapse All"
@@ -447,11 +482,11 @@ msgstr ""
447
  #: ../admin/shortcode-builder/shortcode-builder.php:248
448
  #: ../admin/shortcode-builder/shortcode-builder.php:302
449
  #: ../admin/shortcode-builder/shortcode-builder.php:343
450
- #: ../admin/shortcode-builder/shortcode-builder.php:417
451
- #: ../admin/shortcode-builder/shortcode-builder.php:931
452
- #: ../admin/shortcode-builder/shortcode-builder.php:956
453
- #: ../admin/shortcode-builder/shortcode-builder.php:1003
454
- #: ../admin/shortcode-builder/shortcode-builder.php:1057
455
  msgid "True"
456
  msgstr ""
457
 
@@ -461,11 +496,11 @@ msgstr ""
461
  #: ../admin/shortcode-builder/shortcode-builder.php:252
462
  #: ../admin/shortcode-builder/shortcode-builder.php:306
463
  #: ../admin/shortcode-builder/shortcode-builder.php:347
464
- #: ../admin/shortcode-builder/shortcode-builder.php:421
465
- #: ../admin/shortcode-builder/shortcode-builder.php:935
466
- #: ../admin/shortcode-builder/shortcode-builder.php:960
467
- #: ../admin/shortcode-builder/shortcode-builder.php:1007
468
- #: ../admin/shortcode-builder/shortcode-builder.php:1061
469
  msgid "False"
470
  msgstr ""
471
 
@@ -561,7 +596,7 @@ msgid "Select a repeater template that will display comment data."
561
  msgstr ""
562
 
563
  #: ../admin/shortcode-builder/shortcode-builder.php:167
564
- #: ../admin/shortcode-builder/shortcode-builder.php:1035
565
  msgid "None"
566
  msgstr ""
567
 
@@ -660,37 +695,32 @@ msgstr ""
660
  msgid "Enable the infinite scrolling of single posts."
661
  msgstr ""
662
 
663
- #: ../admin/shortcode-builder/shortcode-builder.php:369
664
- #: ../admin/shortcode-builder/shortcode-builder.php:646
665
  msgid "Taxonomy"
666
  msgstr ""
667
 
668
- #: ../admin/shortcode-builder/shortcode-builder.php:369
669
  msgid ""
670
  "Selecting a taxonomy means only previous posts from the same taxonomy will "
671
  "be returned"
672
  msgstr ""
673
 
674
- #: ../admin/shortcode-builder/shortcode-builder.php:370
675
  msgid "Query previous posts from the same taxonomy."
676
  msgstr ""
677
 
678
- #: ../admin/shortcode-builder/shortcode-builder.php:384
679
- #: ../admin/shortcode-builder/shortcode-builder.php:656
680
- msgid "Select Taxonomy"
681
- msgstr ""
682
-
683
- #: ../admin/shortcode-builder/shortcode-builder.php:385
684
- #: ../admin/shortcode-builder/shortcode-builder.php:528
685
  msgid "Category"
686
  msgstr ""
687
 
688
- #: ../admin/shortcode-builder/shortcode-builder.php:386
689
- #: ../admin/shortcode-builder/shortcode-builder.php:588
690
  msgid "Tag"
691
  msgstr ""
692
 
693
- #: ../admin/shortcode-builder/shortcode-builder.php:396
694
  msgid ""
695
  "You must add the Previous Post shortcode directly to your single template "
696
  "file using the <a href=\"https://developer.wordpress.org/reference/functions/"
@@ -699,394 +729,388 @@ msgid ""
699