WordPress Infinite Scroll – Ajax Load More - Version 2.2.3

Version Description

  • Adding query by Custom Field value(Meta Query).
  • Improved error handling for easier debugging.
  • Fixed issue with pause
Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://connekthq.com/donate/
4
  Tags: ajax, query, loop, paging, filter, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, post format, wmpl
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
- Stable tag: 2.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -41,6 +41,9 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
41
  * **taxonomy** - Query by custom taxonomy name. Default = null
42
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
43
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
 
 
 
44
  * **author** - Query by author id. Default = null
45
  * **search** - Query search term (‘s’). Default = null
46
  * **order** - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’
@@ -181,14 +184,22 @@ How to install Ajax Load More.
181
  == Screenshots ==
182
 
183
  1. Settings screen
184
- 2. The collection of available repeaters
185
- 3. Shortcode Builder (Admin screen)
186
- 4. Shortcode Builder (Page Edit screen)
187
- 5. Content Editor shortcode icon
188
- 6. Shortcode and implementation examples
 
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
 
192
  = 2.2.2 =
193
  * Adding callback function that is dispatched once a successful ajax call is made. $.fn.almComplete(alm).
194
  * Adding WPML support for ICL_LANGUAGE_CODE - A 'lang' atributed is added dynamically if WPML is installed.
4
  Tags: ajax, query, loop, paging, filter, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, post format, wmpl
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
+ Stable tag: 2.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
41
  * **taxonomy** - Query by custom taxonomy name. Default = null
42
  * **taxonomy_terms** - Comma separated list of custom taxonomy terms(slug). Default = null
43
  * **taxonomy_operator** - Operator to compare Taxonomy Terms against (IN/NOT IN). Default = ‘IN’
44
+ * **meta_key** - Custom field key(name). Default = null
45
+ * **meta_value** - Custom field value. Default = null
46
+ * **meta_compare** - Operator to compare meta_key and meta_value against (=/!=/>/>=/</<= etc.). Default = ‘=’
47
  * **author** - Query by author id. Default = null
48
  * **search** - Query search term (‘s’). Default = null
49
  * **order** - Display posts in ASC(ascending) or DESC(descending) order. Default = ‘DESC’
184
  == Screenshots ==
185
 
186
  1. Settings screen
187
+ 2. Available Repeater Templates
188
+ 3. Custom Repeaters Add-On
189
+ 4. Shortcode Builder (Admin screen)
190
+ 5. Shortcode Builder (Page Edit screen)
191
+ 6. Content Editor shortcode icon
192
+ 7. Shortcode and implementation examples
193
 
194
  == Changelog ==
195
 
196
+ = 2.2.3 =
197
+ * Adding query by Custom Field value(Meta Query).
198
+ * Improved error handling for easier debugging.
199
+ * Fixed issue with pause = "true" and scroll = "true". Pause should always take precendence over scroll.
200
+ * Code clean up, improving overall quality for easier merges and updates.
201
+
202
+
203
  = 2.2.2 =
204
  * Adding callback function that is dispatched once a successful ajax call is made. $.fn.almComplete(alm).
205
  * Adding WPML support for ICL_LANGUAGE_CODE - A 'lang' atributed is added dynamically if WPML is installed.
admin/admin.php CHANGED
@@ -253,8 +253,11 @@ function alm_repeater_page(){ ?>
253
  <?php
254
  $filename = ALM_PATH. 'core/repeater/default.php';
255
  $handle = fopen ($filename, "r");
256
- $contents = fread ($handle, filesize ($filename));
257
- fclose ($handle);
 
 
 
258
  ?>
259
  <h3 class="heading"><?php _e('Default Template', ALM_NAME); ?></h3>
260
  <div class="expand-wrap">
@@ -311,36 +314,27 @@ function alm_repeater_page(){ ?>
311
  alias = ($('input._alm_repeater_alias', container).length) ? $('input._alm_repeater_alias', container).val() : '',
312
  responseText = $(".saved-response", container);
313
 
314
- //Get value from CodeMirroweditor
 
315
 
316
- // Default Template
317
- if(editorId === 'template-default')
318
  value = editorDefault.getValue();
 
 
 
 
319
 
320
- //Custom Repeater template add-on
321
- if(editorId === 'template-repeater2')
322
- value = editor_repeater2.getValue();
323
-
324
- if(editorId === 'template-repeater3')
325
- value = editor_repeater3.getValue();
326
-
327
- if(editorId === 'template-repeater4')
328
- value = editor_repeater4.getValue();
329
-
330
- if(editorId === 'template-repeater5')
331
- value = editor_repeater5.getValue();
332
-
333
- if(editorId === 'template-repeater6')
334
- value = editor_repeater6.getValue();
335
-
336
  if(value === '' || value === 'undefined'){
337
- alert("Sorry, an error has occured");
338
- return false;
339
- }
340
-
341
- //If submit button has changed class.
342
- if (btn.hasClass('changed')) { // If repeater value has changed.
343
- responseText.addClass('loading').html('<?php _e('Saving data...', ALM_NAME) ?>');
 
 
344
  $.ajax({
345
  type: 'POST',
346
  url: alm_admin_localize.ajax_admin_url,
@@ -351,30 +345,37 @@ function alm_repeater_page(){ ?>
351
  alias: alias,
352
  nonce: alm_admin_localize.alm_admin_nonce,
353
  },
354
- success: function(e) {
355
- setTimeout(function(){
356
- responseText.html('<?php _e('Template saved successfully', ALM_NAME) ?>').removeClass('loading').addClass('saved');
357
- setTimeout(function() {
358
- responseText.html('&nbsp;').removeClass('saved');
359
- }, 3000);
360
- },1000);
361
- btn.removeClass('changed');
 
 
 
 
 
362
  },
363
  error: function(xhr, status, error) {
364
- responseText.html('<?php _e('Something went wrong and the data could not be saved', ALM_NAME) ?>').removeClass('loading').removeClass('saved');
365
- btn.removeClass('changed');
366
  }
367
- });
 
368
  }
369
  }
 
370
  $('input.save-repeater').each(function(){
371
  $(this).click(function() {
372
  var btn = $(this),
373
- editorId = btn.data('editor-id');
374
- btn.addClass('changed');
375
  _alm_admin.saveRepeater(btn, editorId);
376
  });
377
- });
 
378
  });
379
  </script>
380
  </div>
@@ -425,12 +426,25 @@ function alm_save_repeater(){
425
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
426
  $a = Trim(stripslashes($_POST["alias"])); // Repeater alias
427
  if($n === 'default')
428
- $f = ALM_PATH. '/core/repeater/'.$n .'.php'; // File
429
  else
430
- $f = ALM_REPEATER_PATH. '/repeaters/'.$n .'.php'; // File
431
- $o = fopen($f, 'w+'); //Open file
432
- $w = fwrite($o, $c); //Save the file
433
- $r = fread($o, 100000); //Read it
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  fclose($o); //now close it
435
 
436
  //Save to database
@@ -447,10 +461,11 @@ function alm_save_repeater(){
447
 
448
  //Our results
449
  if($w){
450
- echo 'File saved';
451
  } else {
452
- echo 'Error saving file';
453
  }
 
454
  }
455
 
456
 
@@ -678,21 +693,14 @@ function alm_admin_init(){
678
  'alm_settings',
679
  'alm_sanitize_settings'
680
  );
 
681
  add_settings_section(
682
  'alm_general_settings',
683
  'General Settings',
684
  'alm_general_settings_callback',
685
  'ajax-load-more'
686
  );
687
- /*
688
- add_settings_field(
689
- '_alm_html5',
690
- __('HTML5 Elements', ALM_NAME ),
691
- 'alm_html5_callback',
692
- 'ajax-load-more',
693
- 'alm_general_settings'
694
- );
695
- */
696
  add_settings_field(
697
  '_alm_container_type',
698
  __('Container Type', ALM_NAME ),
253
  <?php
254
  $filename = ALM_PATH. 'core/repeater/default.php';
255
  $handle = fopen ($filename, "r");
256
+ $contents = '';
257
+ if(filesize ($filename) != 0){
258
+ $contents = fread ($handle, filesize ($filename));
259
+ }
260
+ fclose ($handle);
261
  ?>
262
  <h3 class="heading"><?php _e('Default Template', ALM_NAME); ?></h3>
263
  <div class="expand-wrap">
314
  alias = ($('input._alm_repeater_alias', container).length) ? $('input._alm_repeater_alias', container).val() : '',
315
  responseText = $(".saved-response", container);
316
 
317
+ //Get value from CodeMirror textarea
318
+ var id = editorId.replace('template-', ''); // Editor ID
319
 
320
+ if(id === 'default'){ // Default Template
 
321
  value = editorDefault.getValue();
322
+ }else{ // Repeater Templates
323
+ var eid = window['editor_'+id]; // Set editor ID
324
+ value = eid.getValue();
325
+ }
326
 
327
+ // if value is null, then set repeater to non breaking space
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  if(value === '' || value === 'undefined'){
329
+ value = '&nbsp;';
330
+ }
331
+
332
+ //If template is not already saving, then proceed
333
+ if (!btn.hasClass('saving')) {
334
+ btn.addClass('saving');
335
+ responseText.addClass('loading').html('<?php _e('Saving template...', ALM_NAME) ?>');
336
+ responseText.animate({'opacity' : 1});
337
+
338
  $.ajax({
339
  type: 'POST',
340
  url: alm_admin_localize.ajax_admin_url,
345
  alias: alias,
346
  nonce: alm_admin_localize.alm_admin_nonce,
347
  },
348
+ success: function(response) {
349
+
350
+ setTimeout(function() {
351
+ responseText.delay(500).html(response).removeClass('loading');
352
+ }, 250);
353
+
354
+ setTimeout(function() {
355
+ responseText.animate({'opacity': 0}, function(){
356
+ responseText.html('&nbsp;');
357
+ btn.removeClass('saving');
358
+ });
359
+
360
+ }, 6000);
361
  },
362
  error: function(xhr, status, error) {
363
+ responseText.html('<?php _e('Something went wrong and the data could not be saved.', ALM_NAME) ?>').removeClass('loading');
364
+ btn.removeClass('saving');
365
  }
366
+ });
367
+
368
  }
369
  }
370
+
371
  $('input.save-repeater').each(function(){
372
  $(this).click(function() {
373
  var btn = $(this),
374
+ editorId = btn.data('editor-id');
 
375
  _alm_admin.saveRepeater(btn, editorId);
376
  });
377
+ });
378
+
379
  });
380
  </script>
381
  </div>
426
  $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
427
  $a = Trim(stripslashes($_POST["alias"])); // Repeater alias
428
  if($n === 'default')
429
+ $f = ALM_PATH. 'core/repeater/'.$n .'.php'; // File
430
  else
431
+ $f = ALM_REPEATER_PATH. 'repeaters/'.$n .'.php'; // File
432
+
433
+
434
+ $o_error = '<span class="saved-error"><b>'. __('Error Opening File', ALM_NAME) .'</b></span>';
435
+ $o_error .= '<em>'. $f .'</em>';
436
+ $o_error .= __('Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/ plugin directory', ALM_NAME);
437
+
438
+ $w_error = '<span class="saved-error"><b>'. __('Error Saving File', ALM_NAME) .'</b></span>';
439
+ $w_error .= '<em>'. $f .'</em>';
440
+ $w_error .= __('Please check your file path and ensure your server is configured to allow Ajax Load More to read and write files within the /ajax-load-more/ plugin directory', ALM_NAME);
441
+
442
+ //Open file
443
+ $o = fopen($f, 'w+') or die($o_error);
444
+
445
+ //Save/Write the file
446
+ $w = fwrite($o, $c) or die($w_error);
447
+ //$r = fread($o, 100000); //Read it
448
  fclose($o); //now close it
449
 
450
  //Save to database
461
 
462
  //Our results
463
  if($w){
464
+ echo '<span class="saved">Template Saved Successfully</span>';
465
  } else {
466
+ echo '<span class="saved-error"><b>'. __('Error Writing File', ALM_NAME) .'</b></span><br/>Something went wrong and the data could not be saved.';
467
  }
468
+ die();
469
  }
470
 
471
 
693
  'alm_settings',
694
  'alm_sanitize_settings'
695
  );
696
+
697
  add_settings_section(
698
  'alm_general_settings',
699
  'General Settings',
700
  'alm_general_settings_callback',
701
  'ajax-load-more'
702
  );
703
+
 
 
 
 
 
 
 
 
704
  add_settings_field(
705
  '_alm_container_type',
706
  __('Container Type', ALM_NAME ),
admin/css/admin.css CHANGED
@@ -211,7 +211,8 @@
211
  padding: 20px 0 0 !important;
212
  overflow:hidden;
213
  }
214
- .ajax-load-more #taxonomy-extended{
 
215
  display: none;
216
  overflow: hidden;
217
  }
@@ -711,11 +712,27 @@ p.loading{
711
  color:#999;
712
  background: none;
713
  transition: padding 0.2s ease;
714
- float: left;
 
715
  position: relative;
716
  top: 12px;
717
  left: 15px;
718
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  p.loading{
720
  position: static;
721
  }
@@ -723,10 +740,7 @@ p.loading{
723
  p.loading{
724
  background: url(../img/loader.gif) no-repeat left center;
725
  padding-left: 24px;
726
- }
727
- .saved-response.saved{
728
- color: #90be59;
729
- }
730
 
731
  input.save-repeater{
732
  margin-bottom: 10px !important;
@@ -795,14 +809,22 @@ table.highlight{
795
  padding: 0 10px 0 25px !important;
796
  }
797
  .repeaters input.save-repeater{
798
- float: left;
799
  margin: 15px 0 0;
800
  clear: none;
 
801
  }
802
  .repeater-wrap textarea,
803
  .repeater-wrap input[type=text]{
804
  width: 100%;
805
  }
 
 
 
 
 
 
 
806
 
807
 
808
 
211
  padding: 20px 0 0 !important;
212
  overflow:hidden;
213
  }
214
+ .ajax-load-more #taxonomy-extended,
215
+ .ajax-load-more #meta-query-extended{
216
  display: none;
217
  overflow: hidden;
218
  }
712
  color:#999;
713
  background: none;
714
  transition: padding 0.2s ease;
715
+ display: inline-block;
716
+ width: auto;
717
  position: relative;
718
  top: 12px;
719
  left: 15px;
720
  }
721
+
722
+ .saved-error{
723
+ color: #e03e3e;
724
+ }
725
+ .saved-response em{
726
+ color: #333;
727
+ display: block;
728
+ padding: 5px 0;
729
+ }
730
+
731
+ .saved{
732
+ color: #90be59;
733
+ font-weight: 700;
734
+ }
735
+
736
  p.loading{
737
  position: static;
738
  }
740
  p.loading{
741
  background: url(../img/loader.gif) no-repeat left center;
742
  padding-left: 24px;
743
+ }
 
 
 
744
 
745
  input.save-repeater{
746
  margin-bottom: 10px !important;
809
  padding: 0 10px 0 25px !important;
810
  }
811
  .repeaters input.save-repeater{
812
+ display: inline-block;
813
  margin: 15px 0 0;
814
  clear: none;
815
+ max-width: 25%;
816
  }
817
  .repeater-wrap textarea,
818
  .repeater-wrap input[type=text]{
819
  width: 100%;
820
  }
821
+ .repeaters input.save-repeater.saving{
822
+ cursor: default !important;
823
+ }
824
+ .repeaters .saved-response{
825
+ max-width: 72%;
826
+ opacity: 0;
827
+ }
828
 
829
 
830
 
admin/includes/cta/writeable.php CHANGED
@@ -2,12 +2,13 @@
2
  <h3><?php _e('Read/Write Access', ALM_NAME); ?></h3>
3
  <div class="item">
4
  <?php
5
- //Test server for write capabilities
6
- $filename = ALM_PATH .'core/repeater/default.php';
7
- if (is_writable($filename))
8
- echo '<p><i class="fa fa-check"></i><strong>'.__('Write Access Enabled!').'</strong></p><p class="desc">Good news! Your server is configured to read and write files within the plugin directory.';
 
9
  else
10
- echo '<p><i class="fa fa-exclamation"></i><strong>'.__('Write Access Denied!').'</strong></p><p class="desc">Write access on your server is required in order to save repeater data. Please contact your hosting provider or site administrator for more information.';
11
- ?>
12
- </div>
13
  </div>
2
  <h3><?php _e('Read/Write Access', ALM_NAME); ?></h3>
3
  <div class="item">
4
  <?php
5
+ //Test server for write capabilities
6
+ $file = ALM_PATH .'core/repeater/default.php'; // Default ALM repeater
7
+
8
+ if (is_writable($file))
9
+ echo '<p><i class="fa fa-check"></i><strong>'.__('Read/Write Access Enabled').'</strong></p><p class="desc">Good news! Your server is configured to read and write files within the /ajax-load-more/ plugin directory.';
10
  else
11
+ echo '<p><i class="fa fa-exclamation"></i><strong>'.__('Access Denied').'</strong></p><p class="desc">You must enable read and write access for Ajax Load More directories in order to save repeater template data.<br/><br/>Please contact your hosting provider or site administrator for more information.';
12
+ ?>
13
+ </div>
14
  </div>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -1,9 +1,7 @@
1
  jQuery(document).ready(function($) {
2
  "use strict";
3
 
4
- $(".row select, .alm-main select").select2({
5
- minimumResultsForSearch: '100'
6
- });
7
 
8
  var _alm = {},
9
  output_div = $('#shortcode_output'),
@@ -131,14 +129,41 @@ jQuery(document).ready(function($) {
131
  var search = $('.search-term input').val();
132
  search = $.trim(search);
133
  if(search !== '')
134
- output += ' search="'+search+'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
  // ---------------------------
138
  // - Ordering
139
  // ---------------------------
140
  var order = $('select#post-order').val(),
141
- orderby = $('select#post-orderby').val();
142
  if(order !== 'DESC')
143
  output += ' order="'+order+'"';
144
  if(orderby !== 'date')
@@ -234,9 +259,11 @@ jQuery(document).ready(function($) {
234
  * @since 2.0.0
235
  */
236
 
237
- $('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed'); //Select post by default
 
 
238
 
239
- $('.repeater select, .post_types input[type=checkbox], .post_format select, .categories select, .tags select, .authors select, .offset select, .posts_per_page select, .scroll_load input[type=radio], .pause_load input[type=radio], .max_pages select, .transition input[type=radio], #taxonomy-select, #tax-operator-select input[type=radio], #post-order, #post-orderby').change(function() {
240
  $(this).addClass('changed');
241
 
242
  // If post type is not selected, select 'post'.
@@ -251,10 +278,6 @@ jQuery(document).ready(function($) {
251
  _alm.buildShortcode();
252
  });
253
 
254
- $(document).on('change', '#tax-terms-container input[type=checkbox]', function() {
255
- $(this).addClass('changed');
256
- _alm.buildShortcode();
257
- });
258
 
259
  $('.search-term input, .exclude input, .btn-label input').keyup(function() {
260
  $(this).addClass('changed');
1
  jQuery(document).ready(function($) {
2
  "use strict";
3
 
4
+ $(".row select, .alm-main select").select2();
 
 
5
 
6
  var _alm = {},
7
  output_div = $('#shortcode_output'),
129
  var search = $('.search-term input').val();
130
  search = $.trim(search);
131
  if(search !== '')
132
+ output += ' search="'+search+'"';
133
+
134
+
135
+ // ---------------------------
136
+ // - Meta Key
137
+ // ---------------------------
138
+ var meta_key = $.trim($('input#meta-key').val()),
139
+ meta_value = $.trim($('input#meta-value').val()),
140
+ meta_compare = $('select#meta-compare').val();
141
+
142
+ // Set meta_compare default value
143
+ if(meta_compare === '' || meta_compare == undefined)
144
+ meta_compare = '=';
145
+
146
+ if(meta_key !== '' && meta_key !== undefined){
147
+ if($('input#meta-key').hasClass('changed')){
148
+ $('#meta-query-extended').slideDown(200, 'alm_easeInOutQuad');
149
+
150
+ output += ' meta_key="'+meta_key+'"';
151
+ output += ' meta_value="'+meta_value+'"';
152
+
153
+ if(meta_compare !== '=')
154
+ output += ' meta_compare="'+meta_compare+'"';
155
+ }
156
+ }else{
157
+ $('#meta-query-extended').slideUp(200, 'alm_easeInOutQuad');
158
+ $('input#meta-key').removeClass('changed');
159
+ }
160
 
161
 
162
  // ---------------------------
163
  // - Ordering
164
  // ---------------------------
165
  var order = $('select#post-order').val(),
166
+ orderby = $('select#post-orderby').val();
167
  if(order !== 'DESC')
168
  output += ' order="'+order+'"';
169
  if(orderby !== 'date')
259
  * @since 2.0.0
260
  */
261
 
262
+ //Select 'post' by default
263
+ $('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed');
264
+
265
 
266
+ $('.alm_element').on('change keyup', function() {
267
  $(this).addClass('changed');
268
 
269
  // If post type is not selected, select 'post'.
278
  _alm.buildShortcode();
279
  });
280
 
 
 
 
 
281
 
282
  $('.search-term input, .exclude input, .btn-label input').keyup(function() {
283
  $(this).addClass('changed');
admin/shortcode-builder/shortcode-builder.php CHANGED
@@ -11,7 +11,7 @@
11
  echo '<p>'.__('Select your <a href="admin.php?page=ajax-load-more-repeaters" target="_parent">repeater template</a>.', ALM_NAME). '</p>';
12
  echo '</div>';
13
  echo '<div class="wrap"><div class="inner">';
14
- echo '<select name="repeater-select" id="repeater-select">';
15
  echo '<option name="default" id="chk-default" value="default" selected="selected">Default</option>';
16
  if (has_action('alm_get_custom_repeaters')) {
17
  do_action('alm_get_custom_repeaters');
@@ -43,7 +43,7 @@
43
  $typeobj = get_post_type_object( $type );
44
  $name = $typeobj->name;
45
  if( $name != 'revision' && $name != 'attachment' && $name != 'nav_menu_item' && $name != 'acf'){
46
- echo '<li><input type="checkbox" name="chk-'.$typeobj->name.'" id="chk-'.$typeobj->name.'" data-type="'.$typeobj->name.'"><label for="chk-'.$typeobj->name.'">'.$typeobj->labels->singular_name.'</label></li>';
47
  }
48
  }
49
  echo '</ul></div></div>';
@@ -61,7 +61,7 @@
61
  echo '<div class="section-title">';
62
  echo '<p>'.__('Select a <a href="http://codex.wordpress.org/Post_Formats" target="_blank">Post Format</a> to query.', ALM_NAME). '</p>';
63
  echo '</div>';
64
- echo '<div class="wrap"><div class="inner"><select name="post-format-select" id="post-format-select">';
65
  echo '<option value="" selected="selected">-- ' . __('Select Post Format', ALM_NAME) . ' --</option>';
66
  echo '<option name="chk-standard" id="chk-standard" value="chk-standard">' . __('Standard', ALM_NAME) . '</option>';
67
  foreach( $post_formats[0] as $post_format ){
@@ -83,7 +83,7 @@
83
  echo '<div class="section-title">';
84
  echo '<p>' . __('Select a Category to query(by slug).', ALM_NAME) . '</p>';
85
  echo '</div>';
86
- echo '<div class="wrap"><div class="inner"><select name="category-select" id="category-select">';
87
  echo '<option value="" selected="selected">-- ' . __('Select Category', ALM_NAME) . ' --</option>';
88
  foreach( $cats as $cat ){
89
  echo '<option name="chk-'.$cat->slug.'" id="chk-'.$cat->slug.'" value="'.$cat->slug.'">'.$cat->name.'</option>';
@@ -102,7 +102,7 @@
102
  echo '<div class="section-title">';
103
  echo '<p>' . __('Select a Tag to query(by slug).', ALM_NAME) . '</p>';
104
  echo '</div>';
105
- echo '<div class="wrap"><div class="inner"><select name="tag-select" id="tag-select">';
106
  echo '<option value="" selected="selected">-- ' . __('Select Tag', ALM_NAME) . ' --</option>';
107
  foreach( $tags as $tag ){
108
  echo '<option name="chk-'.$tag->slug.'" id="chk-'.$tag->slug.'" value="'.$tag->slug.'">'.$tag->name.'</option>';
@@ -131,7 +131,7 @@
131
  echo '<div class="wrap">';
132
 
133
  echo '<div class="inner">';
134
- echo '<select name="taxonomy-select" id="taxonomy-select">';
135
  echo '<option value="" selected="selected">-- ' . __('Select Taxonomy', ALM_NAME) . ' --</option>';
136
  foreach( $taxonomies as $taxonomy ){
137
  echo '<option name="chk-'.$taxonomy->query_var.'" id="chk-'.$taxonomy->query_var.'" value="'.$taxonomy->query_var.'">'.$taxonomy->label.'</option>';
@@ -148,8 +148,8 @@
148
  echo '<div class="inner border-top" id="tax-operator-select">';
149
  echo '<label class="full">'. __('Taxonomy Operator:', ALM_NAME) .'</label>';
150
  echo '<ul class="radio">';
151
- echo '<li><input name="tax-operator" id="tax-in-radio" value="IN" type="radio" checked="checked"><label for="tax-in-radio">IN (default)</li>';
152
- echo '<li><input name="tax-operator" id="tax-not-in-radio" value="NOT IN" type="radio"><label for="tax-not-in-radio">NOT IN</li>';
153
  echo '</ul>';
154
  echo '</div>';
155
  echo '</div>';
@@ -157,10 +157,55 @@
157
  echo '</div>';
158
  echo '</div>';
159
  echo '</div>';
160
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
 
163
- // List Authors
164
  $authors = get_users();
165
  if($authors){
166
  echo '<div class="row checkboxes authors" id="alm-tags">';
@@ -169,7 +214,7 @@
169
  echo '<div class="section-title">';
170
  echo '<p>' . __('Select an Author to query(by ID).', ALM_NAME) . '</p>';
171
  echo '</div>';
172
- echo '<div class="wrap"><div class="inner"><select name="author-select" id="author-select">';
173
  echo '<option value="" selected="selected">-- ' . __('Select Author', ALM_NAME) . ' --</option>';
174
  foreach( $authors as $author ){
175
  echo '<option name="chk-'.$author->user_login.'" id="chk-'.$author->user_login.'" value="'.$author->ID.'">'.$author->display_name.'</option>';
@@ -189,7 +234,7 @@
189
  </div>
190
  <div class="wrap">
191
  <div class="inner">
192
- <input name="search-term" type="text" id="search-term" value="" placeholder="<?php _e('Enter search term', ALM_NAME); ?>">
193
  </div>
194
  </div>
195
  </div>
@@ -205,14 +250,14 @@
205
  <div class="wrap">
206
  <div class="inner half">
207
  <label class="full">Order:</label>
208
- <select name="post-order" id="post-order">
209
  <option value="DESC" selected="selected">DESC (default)</option>
210
  <option value="ASC">ASC</option>
211
  </select>
212
  </div>
213
  <div class="inner half">
214
  <label class="full">Order By:</label>
215
- <select name="post-orderby" id="post-orderby">
216
  <option value="date" selected="selected">Date (default)</option>
217
  <option value="title">Title</option>
218
  <option value="name">Name (slug)</option>
@@ -225,7 +270,7 @@
225
  </div>
226
  </div>
227
  </div>
228
- </div>
229
 
230
  <!-- Exclude posts -->
231
  <div class="row input exclude" id="alm-exclude-posts">
@@ -236,7 +281,7 @@
236
  </div>
237
  <div class="wrap">
238
  <div class="inner">
239
- <input name="exclude-posts" type="text" id="exclude-posts" value="" placeholder="199, 216, 345, 565">
240
  </div>
241
  </div>
242
  </div>
@@ -251,7 +296,7 @@
251
  </div>
252
  <div class="wrap">
253
  <div class="inner">
254
- <select name="offset-select" id="offset-select">
255
  <script>
256
  var length = 21,
257
  value = '';
@@ -275,7 +320,7 @@
275
  </div>
276
  <div class="wrap">
277
  <div class="inner">
278
- <select name="display_posts-select" id="display_posts-select">
279
  <script>
280
  var length = 31,
281
  value = '';
@@ -306,11 +351,11 @@
306
  <div class="inner">
307
  <ul>
308
  <li>
309
- <input type="radio" name="scroll" value="t" id="scroll_t" checked>
310
  <label for="scroll_t"><?php _e('True', ALM_NAME); ?></label>
311
  </li>
312
  <li>
313
- <input type="radio" name="scroll" value="f" id="scroll_f">
314
  <label for="scroll_f"><?php _e('False', ALM_NAME); ?></label>
315
  </li>
316
  </ul>
@@ -329,7 +374,7 @@
329
  </div>
330
  <div class="wrap">
331
  <div class="inner">
332
- <select name="max-select" id="max-select">
333
  <script>
334
  var length = 11,
335
  value = '';
@@ -361,11 +406,11 @@
361
  <div class="inner">
362
  <ul>
363
  <li>
364
- <input type="radio" name="pause" value="t" id="pause_t">
365
  <label for="pause_t"><?php _e('True', ALM_NAME); ?></label>
366
  </li>
367
  <li>
368
- <input type="radio" name="pause" value="f" id="pause_f" checked>
369
  <label for="pause_f"><?php _e('False', ALM_NAME); ?></label>
370
  </li>
371
  </ul>
@@ -386,11 +431,11 @@
386
  <div class="inner">
387
  <ul>
388
  <li>
389
- <input type="radio" name="transition" value="slide" id="transition-slide" checked>
390
  <label for="transition-slide"><?php _e('Slide', ALM_NAME); ?></label>
391
  </li>
392
  <li>
393
- <input type="radio" name="transition" value="fade" id="transition-fade">
394
  <label for="transition-fade"><?php _e('Fade', ALM_NAME); ?></label>
395
  </li>
396
  </ul>
@@ -409,7 +454,7 @@
409
  </div>
410
  <div class="wrap">
411
  <div class="inner">
412
- <input name="button-label" type="text" id="button-label" value="<?php _e('Older Posts', ALM_NAME); ?>">
413
  </div>
414
  </div>
415
  </div>
11
  echo '<p>'.__('Select your <a href="admin.php?page=ajax-load-more-repeaters" target="_parent">repeater template</a>.', ALM_NAME). '</p>';
12
  echo '</div>';
13
  echo '<div class="wrap"><div class="inner">';
14
+ echo '<select name="repeater-select" id="repeater-select" class="alm_element">';
15
  echo '<option name="default" id="chk-default" value="default" selected="selected">Default</option>';
16
  if (has_action('alm_get_custom_repeaters')) {
17
  do_action('alm_get_custom_repeaters');
43
  $typeobj = get_post_type_object( $type );
44
  $name = $typeobj->name;
45
  if( $name != 'revision' && $name != 'attachment' && $name != 'nav_menu_item' && $name != 'acf'){
46
+ echo '<li><input class="alm_element" type="checkbox" name="chk-'.$typeobj->name.'" id="chk-'.$typeobj->name.'" data-type="'.$typeobj->name.'"><label for="chk-'.$typeobj->name.'">'.$typeobj->labels->singular_name.'</label></li>';
47
  }
48
  }
49
  echo '</ul></div></div>';
61
  echo '<div class="section-title">';
62
  echo '<p>'.__('Select a <a href="http://codex.wordpress.org/Post_Formats" target="_blank">Post Format</a> to query.', ALM_NAME). '</p>';
63
  echo '</div>';
64
+ echo '<div class="wrap"><div class="inner"><select class="alm_element" name="post-format-select" id="post-format-select">';
65
  echo '<option value="" selected="selected">-- ' . __('Select Post Format', ALM_NAME) . ' --</option>';
66
  echo '<option name="chk-standard" id="chk-standard" value="chk-standard">' . __('Standard', ALM_NAME) . '</option>';
67
  foreach( $post_formats[0] as $post_format ){
83
  echo '<div class="section-title">';
84
  echo '<p>' . __('Select a Category to query(by slug).', ALM_NAME) . '</p>';
85
  echo '</div>';
86
+ echo '<div class="wrap"><div class="inner"><select class="alm_element" name="category-select" id="category-select">';
87
  echo '<option value="" selected="selected">-- ' . __('Select Category', ALM_NAME) . ' --</option>';
88
  foreach( $cats as $cat ){
89
  echo '<option name="chk-'.$cat->slug.'" id="chk-'.$cat->slug.'" value="'.$cat->slug.'">'.$cat->name.'</option>';
102
  echo '<div class="section-title">';
103
  echo '<p>' . __('Select a Tag to query(by slug).', ALM_NAME) . '</p>';
104
  echo '</div>';
105
+ echo '<div class="wrap"><div class="inner"><select class="alm_element" name="tag-select" id="tag-select">';
106
  echo '<option value="" selected="selected">-- ' . __('Select Tag', ALM_NAME) . ' --</option>';
107
  foreach( $tags as $tag ){
108
  echo '<option name="chk-'.$tag->slug.'" id="chk-'.$tag->slug.'" value="'.$tag->slug.'">'.$tag->name.'</option>';
131
  echo '<div class="wrap">';
132
 
133
  echo '<div class="inner">';
134
+ echo '<select class="alm_element" name="taxonomy-select" id="taxonomy-select">';
135
  echo '<option value="" selected="selected">-- ' . __('Select Taxonomy', ALM_NAME) . ' --</option>';
136
  foreach( $taxonomies as $taxonomy ){
137
  echo '<option name="chk-'.$taxonomy->query_var.'" id="chk-'.$taxonomy->query_var.'" value="'.$taxonomy->query_var.'">'.$taxonomy->label.'</option>';
148
  echo '<div class="inner border-top" id="tax-operator-select">';
149
  echo '<label class="full">'. __('Taxonomy Operator:', ALM_NAME) .'</label>';
150
  echo '<ul class="radio">';
151
+ 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>';
152
+ 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>';
153
  echo '</ul>';
154
  echo '</div>';
155
  echo '</div>';
157
  echo '</div>';
158
  echo '</div>';
159
  echo '</div>';
160
+ }?>
161
+
162
+ <?php // Custom Fields ?>
163
+ <div class="row input meta-key" id="alm-meta-key">
164
+ <h3 class="heading"><?php _e('Custom Fields (Meta)', ALM_NAME); ?></h3>
165
+ <div class="expand-wrap">
166
+ <div class="section-title">
167
+ <p><?php _e('Query by <a href="http://codex.wordpress.org/Class_Reference/WP_Meta_Query" target="_blank">custom fields</a>. Enter your key(name) and value, then select your operator.', ALM_NAME); ?></p>
168
+ </div>
169
+ <div class="wrap">
170
+ <div class="inner">
171
+ <div class="inner">
172
+ <label for="meta-key" class="full"><?php _e('Field Key (Name):', ALM_NAME); ?></label>
173
+ <input class="alm_element" name="meta-key" type="text" id="meta-key" value="" placeholder="<?php _e('Enter custom field key(name)', ALM_NAME); ?>">
174
+ </div>
175
+ </div>
176
+ <div id="meta-query-extended">
177
+ <?php // Meta Value ?>
178
+ <div class="inner border-top">
179
+ <label for="meta-value" class="full"><?php _e('Field Value:', ALM_NAME); ?></label>
180
+ <input class="alm_element" name="meta-value" type="text" id="meta-value" value="" placeholder="<?php _e('Enter custom field value', ALM_NAME); ?>">
181
+ </div>
182
+ <?php // Meta Compare ?>
183
+ <div class="inner border-top">
184
+ <label for="meta-compare" class="full"><?php _e('Field Operator:', ALM_NAME); ?></label>
185
+ <select class="alm_element" id="meta-compare" name="meta-compare">
186
+ <option value="=" selected="selected">= &nbsp;&nbsp; (equals)</option>
187
+ <option value="!=">!= &nbsp; (does NOT equal)</option>
188
+ <option value=">">> &nbsp;&nbsp; (greater than)</option>
189
+ <option value=">=">>= &nbsp;(greater than or equal to)</option>
190
+ <option value="<">&lt; &nbsp;&nbsp; (less than)</option>
191
+ <option value="<=">&lt;= &nbsp;(less than or equal to)</option>
192
+ <option value="LIKE">LIKE</option>
193
+ <option value="NOT LIKE">NOT LIKE</option>
194
+ <option value="IN">IN</option>
195
+ <option value="NOT IN">NOT IN</option>
196
+ <option value="BETWEEN">BETWEEN</option>
197
+ <option value="NOT BETWEEN">NOT BETWEEN</option>
198
+ <option value="EXISTS">EXISTS</option>
199
+ <option value="NOT EXISTS">NOT EXISTS</option>
200
+ </select>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ </div>
206
 
207
 
208
+ <?php // List Authors
209
  $authors = get_users();
210
  if($authors){
211
  echo '<div class="row checkboxes authors" id="alm-tags">';
214
  echo '<div class="section-title">';
215
  echo '<p>' . __('Select an Author to query(by ID).', ALM_NAME) . '</p>';
216
  echo '</div>';
217
+ echo '<div class="wrap"><div class="inner"><select class="alm_element" name="author-select" id="author-select">';
218
  echo '<option value="" selected="selected">-- ' . __('Select Author', ALM_NAME) . ' --</option>';
219
  foreach( $authors as $author ){
220
  echo '<option name="chk-'.$author->user_login.'" id="chk-'.$author->user_login.'" value="'.$author->ID.'">'.$author->display_name.'</option>';
234
  </div>
235
  <div class="wrap">
236
  <div class="inner">
237
+ <input name="search-term" class="alm_element" type="text" id="search-term" value="" placeholder="<?php _e('Enter search term', ALM_NAME); ?>">
238
  </div>
239
  </div>
240
  </div>
250
  <div class="wrap">
251
  <div class="inner half">
252
  <label class="full">Order:</label>
253
+ <select class="alm_element" name="post-order" id="post-order">
254
  <option value="DESC" selected="selected">DESC (default)</option>
255
  <option value="ASC">ASC</option>
256
  </select>
257
  </div>
258
  <div class="inner half">
259
  <label class="full">Order By:</label>
260
+ <select class="alm_element" name="post-orderby" id="post-orderby">
261
  <option value="date" selected="selected">Date (default)</option>
262
  <option value="title">Title</option>
263
  <option value="name">Name (slug)</option>
270
  </div>
271
  </div>
272
  </div>
273
+ </div>
274
 
275
  <!-- Exclude posts -->
276
  <div class="row input exclude" id="alm-exclude-posts">
281
  </div>
282
  <div class="wrap">
283
  <div class="inner">
284
+ <input class="alm_element" name="exclude-posts" type="text" id="exclude-posts" value="" placeholder="199, 216, 345, 565">
285
  </div>
286
  </div>
287
  </div>
296
  </div>
297
  <div class="wrap">
298
  <div class="inner">
299
+ <select class="alm_element" name="offset-select" id="offset-select">
300
  <script>
301
  var length = 21,
302
  value = '';
320
  </div>
321
  <div class="wrap">
322
  <div class="inner">
323
+ <select class="alm_element" name="display_posts-select" id="display_posts-select">
324
  <script>
325
  var length = 31,
326
  value = '';
351
  <div class="inner">
352
  <ul>
353
  <li>
354
+ <input class="alm_element" type="radio" name="scroll" value="t" id="scroll_t" checked>
355
  <label for="scroll_t"><?php _e('True', ALM_NAME); ?></label>
356
  </li>
357
  <li>
358
+ <input class="alm_element" type="radio" name="scroll" value="f" id="scroll_f">
359
  <label for="scroll_f"><?php _e('False', ALM_NAME); ?></label>
360
  </li>
361
  </ul>
374
  </div>
375
  <div class="wrap">
376
  <div class="inner">
377
+ <select class="alm_element" name="max-select" id="max-select">
378
  <script>
379
  var length = 11,
380
  value = '';
406
  <div class="inner">
407
  <ul>
408
  <li>
409
+ <input class="alm_element" type="radio" name="pause" value="t" id="pause_t">
410
  <label for="pause_t"><?php _e('True', ALM_NAME); ?></label>
411
  </li>
412
  <li>
413
+ <input class="alm_element" type="radio" name="pause" value="f" id="pause_f" checked>
414
  <label for="pause_f"><?php _e('False', ALM_NAME); ?></label>
415
  </li>
416
  </ul>
431
  <div class="inner">
432
  <ul>
433
  <li>
434
+ <input class="alm_element" type="radio" name="transition" value="slide" id="transition-slide" checked>
435
  <label for="transition-slide"><?php _e('Slide', ALM_NAME); ?></label>
436
  </li>
437
  <li>
438
+ <input class="alm_element" type="radio" name="transition" value="fade" id="transition-fade">
439
  <label for="transition-fade"><?php _e('Fade', ALM_NAME); ?></label>
440
  </li>
441
  </ul>
454
  </div>
455
  <div class="wrap">
456
  <div class="inner">
457
+ <input class="alm_element" name="button-label" type="text" id="button-label" value="<?php _e('Older Posts', ALM_NAME); ?>">
458
  </div>
459
  </div>
460
  </div>
ajax-load-more.php CHANGED
@@ -6,14 +6,14 @@ Description: A simple solution for lazy loading WordPress posts and pages with A
6
  Author: Darren Cooney
7
  Twitter: @KaptonKaos
8
  Author URI: http://connekthq.com
9
- Version: 2.2.2
10
  License: GPL
11
  Copyright: Darren Cooney & Connekt Media
12
  */
13
 
14
 
15
- define('ALM_VERSION', '2.2.2');
16
- define('ALM_RELEASE', 'September 23, 2014');
17
 
18
  /*
19
  * alm_install
@@ -73,6 +73,8 @@ if( !class_exists('AjaxLoadMore') ):
73
  add_action('wp_ajax_nopriv_ajax_load_more_init', array(&$this, 'alm_query_posts'));
74
  add_action('wp_enqueue_scripts', array(&$this, 'alm_enqueue_scripts'));
75
  add_action('alm_get_repeater', array(&$this, 'alm_get_current_repeater'));
 
 
76
  add_shortcode('ajax_load_more', array(&$this, 'alm_shortcode'));
77
 
78
  // Allow shortcodes in widget areas
@@ -99,6 +101,21 @@ if( !class_exists('AjaxLoadMore') ):
99
  include_once('admin/admin.php');
100
  }
101
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  /*
104
  * alm_enqueue_scripts
@@ -141,10 +158,13 @@ if( !class_exists('AjaxLoadMore') ):
141
  'category' => '',
142
  'taxonomy' => '',
143
  'taxonomy_terms' => '',
144
- 'taxonomy_operator' => '',
 
 
 
145
  'tag' => '',
146
  'author' => '',
147
- 'search' => '',
148
  'order' => '',
149
  'orderby' => '',
150
  'exclude' => '',
@@ -177,7 +197,7 @@ if( !class_exists('AjaxLoadMore') ):
177
  $lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';
178
 
179
  $ajaxloadmore = '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .'">';
180
- $ajaxloadmore .= '<'.$container_element.' class="alm-listing'. $classname . '" data-repeater="'.$repeater.'" data-post-type="'.$post_type.'" data-post-format="'.$post_format.'" data-category="'.$category.'" data-taxonomy="'.$taxonomy.'" data-taxonomy-terms="'.$taxonomy_terms.'" data-taxonomy-operator="'.$taxonomy_operator.'" data-tag="'.$tag.'" data-author="'.$author.'" data-search="'.$search.'" data-order="'.$order.'" data-orderby="'.$orderby.'" data-exclude="'.$exclude.'" data-offset="'.$offset.'" data-posts-per-page="'.$posts_per_page.'" data-lang="'.$lang.'" data-scroll="'.$scroll.'" data-max-pages="'.$max_pages.'" data-pause="'. $pause .'" data-button-label="'.$button_label.'" data-transition="'.$transition.'"></'.$container_element.'>';
181
  $ajaxloadmore .= '</div>';
182
 
183
  return $ajaxloadmore;
@@ -204,6 +224,7 @@ if( !class_exists('AjaxLoadMore') ):
204
  $postType = (isset($_GET['postType'])) ? $_GET['postType'] : 'post';
205
  $postFormat = (isset($_GET['postFormat'])) ? $_GET['postFormat'] : '';
206
  $category = (isset($_GET['category'])) ? $_GET['category'] : '';
 
207
  $author_id = (isset($_GET['author'])) ? $_GET['author'] : '';
208
 
209
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
@@ -214,8 +235,15 @@ if( !class_exists('AjaxLoadMore') ):
214
  }
215
 
216
  $post_format = (isset($_GET['postFormat'])) ? $_GET['postFormat'] : '';
217
- $tag = (isset($_GET['tag'])) ? $_GET['tag'] : '';
218
  $s = (isset($_GET['search'])) ? $_GET['search'] : '';
 
 
 
 
 
 
 
 
219
  $order = (isset($_GET['order'])) ? $_GET['order'] : 'DESC';
220
  $orderby = (isset($_GET['orderby'])) ? $_GET['orderby'] : 'date';
221
  $exclude = (isset($_GET['exclude'])) ? $_GET['exclude'] : '';
@@ -249,7 +277,7 @@ if( !class_exists('AjaxLoadMore') ):
249
  $args['post__not_in'] = $exclude;
250
  }
251
 
252
- // Post Format query
253
  if(!empty($postFormat)){
254
  $format = "post-format-$postFormat";
255
  //If query is for standrd we need to filter by NOT IN
@@ -279,7 +307,7 @@ if( !class_exists('AjaxLoadMore') ):
279
  }
280
  }
281
 
282
- // Taxonomy query
283
  if(!empty($taxonomy)){
284
  $the_terms = explode(", ", $taxonomy_terms);
285
  $args['tax_query'] = array(
@@ -292,18 +320,32 @@ if( !class_exists('AjaxLoadMore') ):
292
  ),
293
  );
294
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
 
296
 
297
- // Query by $args
298
  $alm_query = new WP_Query( $args );
299
 
300
- // the WP loop
301
  if ($alm_query->have_posts()) :
302
  while ($alm_query->have_posts()): $alm_query->the_post();
303
  $file = $repeater;
304
  $include = '';
305
  $found = false;
306
- if (has_action('alm_repeater_installed')){// If Custom Repeaters is installed
307
  $repeaterLength = ALM_REPEATER_LENGTH;
308
  if(!defined('ALM_REPEATER_LENGTH')){
309
  $repeaterLength = 6;
6
  Author: Darren Cooney
7
  Twitter: @KaptonKaos
8
  Author URI: http://connekthq.com
9
+ Version: 2.2.4
10
  License: GPL
11
  Copyright: Darren Cooney & Connekt Media
12
  */
13
 
14
 
15
+ define('ALM_VERSION', '2.2.4');
16
+ define('ALM_RELEASE', 'October 27, 2014');
17
 
18
  /*
19
  * alm_install
73
  add_action('wp_ajax_nopriv_ajax_load_more_init', array(&$this, 'alm_query_posts'));
74
  add_action('wp_enqueue_scripts', array(&$this, 'alm_enqueue_scripts'));
75
  add_action('alm_get_repeater', array(&$this, 'alm_get_current_repeater'));
76
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'alm_action_links'));
77
+
78
  add_shortcode('ajax_load_more', array(&$this, 'alm_shortcode'));
79
 
80
  // Allow shortcodes in widget areas
101
  include_once('admin/admin.php');
102
  }
103
  }
104
+
105
+ /*
106
+ * alm_action_links
107
+ * Add plugin action links to WP plugin screen
108
+ *
109
+ * @since 2.2.3
110
+ */
111
+
112
+ function alm_action_links( $links ) {
113
+ $links[] = '<a href="'. get_admin_url(null, 'admin.php?page=ajax-load-more') .'">Settings</a>';
114
+ $links[] = '<a href="'. get_admin_url(null, 'admin.php?page=ajax-load-more-shortcode-builder') .'">Shortcode Builder</a>';
115
+ return $links;
116
+ }
117
+
118
+
119
 
120
  /*
121
  * alm_enqueue_scripts
158
  'category' => '',
159
  'taxonomy' => '',
160
  'taxonomy_terms' => '',
161
+ 'taxonomy_operator' => '',
162
+ 'meta_key' => '',
163
+ 'meta_value' => '',
164
+ 'meta_compare' => '',
165
  'tag' => '',
166
  'author' => '',
167
+ 'search' => '',
168
  'order' => '',
169
  'orderby' => '',
170
  'exclude' => '',
197
  $lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';
198
 
199
  $ajaxloadmore = '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .'">';
200
+ $ajaxloadmore .= '<'.$container_element.' class="alm-listing'. $classname . '" data-repeater="'.$repeater.'" data-post-type="'.$post_type.'" data-post-format="'.$post_format.'" data-category="'.$category.'" data-taxonomy="'.$taxonomy.'" data-taxonomy-terms="'.$taxonomy_terms.'" data-taxonomy-operator="'.$taxonomy_operator.'" data-tag="'.$tag.'" data-meta-key="'.$meta_key.'" data-meta-value="'.$meta_value.'" data-meta-compare="'.$meta_compare.'" data-author="'.$author.'" data-search="'.$search.'" data-order="'.$order.'" data-orderby="'.$orderby.'" data-exclude="'.$exclude.'" data-offset="'.$offset.'" data-posts-per-page="'.$posts_per_page.'" data-lang="'.$lang.'" data-scroll="'.$scroll.'" data-max-pages="'.$max_pages.'" data-pause="'. $pause .'" data-button-label="'.$button_label.'" data-transition="'.$transition.'"></'.$container_element.'>';
201
  $ajaxloadmore .= '</div>';
202
 
203
  return $ajaxloadmore;
224
  $postType = (isset($_GET['postType'])) ? $_GET['postType'] : 'post';
225
  $postFormat = (isset($_GET['postFormat'])) ? $_GET['postFormat'] : '';
226
  $category = (isset($_GET['category'])) ? $_GET['category'] : '';
227
+ $tag = (isset($_GET['tag'])) ? $_GET['tag'] : '';
228
  $author_id = (isset($_GET['author'])) ? $_GET['author'] : '';
229
 
230
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
235
  }
236
 
237
  $post_format = (isset($_GET['postFormat'])) ? $_GET['postFormat'] : '';
 
238
  $s = (isset($_GET['search'])) ? $_GET['search'] : '';
239
+
240
+ $meta_key = (isset($_GET['meta_key'])) ? $_GET['meta_key'] : '';
241
+ $meta_value = (isset($_GET['meta_value'])) ? $_GET['meta_value'] : '';
242
+ $meta_compare = (isset($_GET['meta_compare'])) ? $_GET['meta_compare'] : '';
243
+ if($meta_compare == ''){
244
+ $meta_compare = '=';
245
+ }
246
+
247
  $order = (isset($_GET['order'])) ? $_GET['order'] : 'DESC';
248
  $orderby = (isset($_GET['orderby'])) ? $_GET['orderby'] : 'date';
249
  $exclude = (isset($_GET['exclude'])) ? $_GET['exclude'] : '';
277
  $args['post__not_in'] = $exclude;
278
  }
279
 
280
+ // Post Format
281
  if(!empty($postFormat)){
282
  $format = "post-format-$postFormat";
283
  //If query is for standrd we need to filter by NOT IN
307
  }
308
  }
309
 
310
+ // Taxonomy
311
  if(!empty($taxonomy)){
312
  $the_terms = explode(", ", $taxonomy_terms);
313
  $args['tax_query'] = array(
320
  ),
321
  );
322
  }
323
+
324
+ // Meta Query
325
+ if(!empty($meta_key) && !empty($meta_value)){
326
+ echo $meta_key . ' - ';
327
+ echo $meta_value . ' - ';
328
+ echo $meta_compare;
329
+ $args['meta_query'] = array(
330
+ array(
331
+ 'key' => $meta_key,
332
+ 'value' => $meta_value,
333
+ 'compare' => $meta_compare,
334
+ ),
335
+ );
336
+ }
337
 
338
 
339
+ // WP_Query()
340
  $alm_query = new WP_Query( $args );
341
 
342
+ // Run the loop
343
  if ($alm_query->have_posts()) :
344
  while ($alm_query->have_posts()): $alm_query->the_post();
345
  $file = $repeater;
346
  $include = '';
347
  $found = false;
348
+ if (has_action('alm_repeater_installed')){// If Custom Repeaters add-on is installed
349
  $repeaterLength = ALM_REPEATER_LENGTH;
350
  if(!defined('ALM_REPEATER_LENGTH')){
351
  $repeaterLength = 6;
core/js/ajax-load-more.js CHANGED
@@ -9,278 +9,279 @@
9
  *
10
  * Author: Darren Cooney
11
  * Twitter: @KaptonKaos
12
- */
13
 
14
- (function($) {
15
- "use strict";
16
- $.ajaxloadmore = function(el) {
17
- //Set variables
18
- var alm = this;
19
- alm.AjaxLoadMore = {};
20
- alm.page = 0;
21
- alm.speed = 300;
22
- alm.proceed = false;
23
- alm.init = true;
24
- alm.loading = true;
25
- alm.finished = false;
26
- alm.window = $(window);
27
- alm.button_label = '';
28
- alm.data;
29
- alm.el = el;
30
- alm.content = $('.alm-listing', alm.el);
31
- alm.scroll = true;
32
- alm.prefix = 'alm-';
33
- alm.repeater = alm.content.data('repeater');
34
- alm.max_pages = alm.content.data('max-pages');
35
- alm.pause = alm.content.data('pause');
36
- alm.offset = alm.content.data('offset');
37
- alm.transition = alm.content.data('transition');
38
- alm.lang = alm.content.data('lang'),
39
- alm.posts_per_page = alm.content.data('posts-per-page');
40
-
41
- $(window).scrollTop(0); //Prevent loading of unnessasry posts - move user to top of page
42
-
43
- // Check for pause on init
44
- // Pause could be used to hold the loading of posts for a button click.
45
- if (alm.pause === undefined) {
46
- alm.pause = false;
47
- }
48
-
49
- // Select the repeater template
50
- if (alm.repeater === undefined) {
51
- alm.repeater = 'default';
52
- }
53
-
54
- // Max number of pages to load while scrolling
55
- if (alm.max_pages === undefined) {
56
- alm.max_pages = 5;
57
- }
58
- if (alm.max_pages === 'none') {
59
- alm.max_pages = 1000000;
60
- }
61
-
62
- // select the transition
63
- if (alm.transition === undefined) {
64
- alm.transition = 'slide';
65
- } else if (alm.transition === "fade") {
66
- alm.transition = 'fade';
67
- } else {
68
- alm.transition = 'slide';
69
- }
70
-
71
- // Define offset
72
- if (alm.content.data('offset') === undefined) {
73
- alm.offset = 0;
74
- } else {
75
- alm.offset = alm.content.data('offset');
76
- }
77
-
78
- // Define button text
79
- if (alm.content.data('button-label') === undefined) {
80
- alm.button_label = 'Older Posts';
81
- } else {
82
- alm.button_label = alm.content.data('button-label');
83
- }
84
-
85
- // Define on Scroll event
86
- if (alm.content.data('scroll') === undefined) {
87
- alm.scroll = true;
88
- } else if (alm.content.data('scroll') === false) {
89
- alm.scroll = false;
90
- } else {
91
- alm.scroll = true;
92
- }
93
-
94
- // Parse multiple Post Types
95
- alm.post_type = alm.content.data('post-type');
96
- alm.post_type = alm.post_type.split(",");
97
-
98
- // Append 'load More' button to .ajax-load-more-wrap
99
- alm.el.append('<div class="'+alm.prefix+'btn-wrap"><button id="load-more" class="'+alm.prefix+'load-more-btn more">' + alm.button_label + '</button></div>');
100
- alm.button = $('.alm-load-more-btn', alm.el);
101
-
102
-
103
- /* loadPosts()
104
- *
105
- * The function to get posts via Ajax
106
- * @since 2.0.0
107
- */
108
- alm.AjaxLoadMore.loadPosts = function() {
109
- alm.button.addClass('loading');
110
- alm.loading = true;
111
- $.ajax({
112
- type: "GET",
113
- url: alm_localize.ajaxurl,
114
- data: {
115
- action: 'ajax_load_more_init',
116
- nonce: alm_localize.alm_nonce,
117
- repeater: alm.repeater,
118
- postType: alm.post_type,
119
- postFormat: alm.content.data('post-format'),
120
- category: alm.content.data('category'),
121
- author: alm.content.data('author'),
122
- taxonomy: alm.content.data('taxonomy'),
123
- taxonomy_terms: alm.content.data('taxonomy-terms'),
124
- taxonomy_operator: alm.content.data('taxonomy-operator'),
125
- tag: alm.content.data('tag'),
126
- order: alm.content.data('order'),
127
- orderby: alm.content.data('orderby'),
128
- search: alm.content.data('search'),
129
- exclude: alm.content.data('exclude'),
130
- numPosts: alm.content.data('posts-per-page'),
131
- pageNumber: alm.page,
132
- offset: alm.offset,
133
- lang: alm.lang
134
- },
135
- dataType: "html",
136
- // parse the data as html
137
- beforeSend: function() {
138
- if (alm.page != 1) {
139
- alm.button.addClass('loading');
140
- }
141
- },
142
- success: function(data) {
143
- alm.data = $(data); // Convert data to an object
144
- //console.log(alm.data.length);
145
- if (alm.init) {
146
- alm.button.text(alm.button_label);
147
- alm.init = false;
148
- }
149
- if (alm.data.length > 0) {
150
- alm.el = $('<div class="' + alm.prefix + 'reveal"/>');
151
- alm.el.append(alm.data);
152
- alm.el.hide();
153
- alm.content.append(alm.el);
154
- if (alm.transition === 'fade') { // Fade transition
155
- alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function() {
156
- alm.loading = false;
157
- alm.button.delay(alm.speed).removeClass('loading');
158
- if (alm.data.length < alm.posts_per_page) {
159
- alm.finished = true;
160
- alm.button.addClass('done');
161
- }
162
- });
163
- } else { // Slide transition
164
- alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function() {
165
- alm.loading = false;
166
- alm.button.delay(alm.speed).removeClass('loading');
167
- if (alm.data.length < alm.posts_per_page) {
168
- alm.finished = true;
169
- alm.button.addClass('done');
170
- }
171
- });
172
- }
173
-
174
- if ($.isFunction($.fn.almComplete)) {
175
- $.fn.almComplete(alm);
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
- } else {
179
- alm.button.delay(alm.speed).removeClass('loading').addClass('done');
180
- alm.loading = false;
181
- alm.finished = true;
182
- }
183
- },
184
- error: function(jqXHR, textStatus, errorThrown) {
185
- alm.loading = false;
186
- alm.button.removeClass('loading');
187
- }
188
- });
189
- };
190
-
191
-
192
- /* Button onClick()
193
- *
194
- * Load more button click event
195
- * @since 1.0.0
196
- */
197
- alm.button.on('click', function() {
198
- if(alm.pause === true){
199
- alm.pause = false;
200
- alm.AjaxLoadMore.loadPosts();
201
- }
202
- if (!alm.loading && !alm.finished && !$(this).hasClass('done')) {
203
- alm.loading = true;
204
- alm.page++;
205
- alm.AjaxLoadMore.loadPosts();
206
- }
207
- });
208
-
209
-
210
- /* AjaxLoadMore.isVisible()
211
- *
212
- * Check to see if element is visible before loading posts
213
- * @since 2.1.2
214
- */
215
- alm.AjaxLoadMore.isVisible = function(){
216
- alm.visible = false;
217
- if(alm.el.is(":visible")){
218
- alm.visible = true;
219
- }
220
- return alm.visible;
221
- };
222
-
223
-
224
- /* Window scroll and touchmove events
225
- *
226
- * Load posts as user scrolls the page
227
- * @since 1.0
228
- */
229
- if (alm.scroll) {
230
- alm.window.bind("scroll touchstart", function() {
231
- if(alm.AjaxLoadMore.isVisible()){
232
- var content_offset = alm.button.offset();
233
- if (!alm.loading && !alm.finished && alm.window.scrollTop() >= Math.round(content_offset.top - (alm.window.height() - 150)) && alm.page < (alm.max_pages - 1) && alm.proceed) {
234
- alm.loading = true;
235
- alm.page++;
236
- alm.AjaxLoadMore.loadPosts();
237
- }
238
- }
239
- });
240
- }
241
-
242
-
243
- //Check for pause variable
244
- if(alm.pause === true){
245
- alm.button.text(alm.button_label);
246
- alm.loading = false;
247
- }else{
248
- alm.AjaxLoadMore.loadPosts();
249
- }
250
-
251
-
252
- //flag to prevent unnecessary loading of post on init. Hold for 1 second
253
- setTimeout(function() {
254
- alm.proceed = true;
255
- }, 1000);
256
-
257
-
258
- //Custom easing function
259
- $.easing.alm_easeInOutQuad = function(x, t, b, c, d) {
260
- if ((t /= d / 2) < 1) return c / 2 * t * t + b;
261
- return -c / 2 * ((--t) * (t - 2) - 1) + b;
262
- };
263
- };
264
-
265
- // End $.ajaxloadmore
266
-
267
-
268
- /* $.fn.ajaxloadmore()
269
- *
270
- * Initiate all instances of Ajax load More
271
- * @since 2.1.2
272
- */
273
- $.fn.ajaxloadmore = function() {
274
- return this.each(function() {
275
- $(this).data('alm', new $.ajaxloadmore($(this)));
276
- });
277
- }
278
-
279
  /*
280
- * Initiate Ajax load More if div is present on screen
281
- * @since 2.1.2
282
- */
283
- if($(".ajax-load-more-wrap").length)
284
- $(".ajax-load-more-wrap").ajaxloadmore();
285
-
286
  })(jQuery);
9
  *
10
  * Author: Darren Cooney
11
  * Twitter: @KaptonKaos
12
+ */
13
 
14
+ (function ($) {
15
+ "use strict";
16
+ $.ajaxloadmore = function (el) {
17
+
18
+ //Set variables
19
+ var alm = this;
20
+ alm.AjaxLoadMore = {};
21
+ alm.page = 0;
22
+ alm.speed = 300;
23
+ alm.proceed = false;
24
+ alm.init = true;
25
+ alm.loading = true;
26
+ alm.finished = false;
27
+ alm.window = $(window);
28
+ alm.button_label = '';
29
+ alm.data;
30
+ alm.el = el;
31
+ alm.content = $('.alm-listing', alm.el);
32
+ alm.scroll = true;
33
+ alm.prefix = 'alm-';
34
+ alm.repeater = alm.content.data('repeater');
35
+ alm.max_pages = alm.content.data('max-pages');
36
+ alm.pause = alm.content.data('pause');
37
+ alm.offset = alm.content.data('offset');
38
+ alm.transition = alm.content.data('transition');
39
+ alm.lang = alm.content.data('lang'),
40
+ alm.posts_per_page = alm.content.data('posts-per-page');
41
+
42
+ $(window).scrollTop(0); //Prevent loading of unnessasry posts - move user to top of page
43
+ // Check for pause on init
44
+ // Pause could be used to hold the loading of posts for a button click.
45
+ if (alm.pause === undefined) {
46
+ alm.pause = false;
47
+ }
48
+
49
+ // Select the repeater template
50
+ if (alm.repeater === undefined) {
51
+ alm.repeater = 'default';
52
+ }
53
+
54
+ // Max number of pages to load while scrolling
55
+ if (alm.max_pages === undefined) {
56
+ alm.max_pages = 5;
57
+ }
58
+ if (alm.max_pages === 'none') {
59
+ alm.max_pages = 1000000;
60
+ }
61
+
62
+ // select the transition
63
+ if (alm.transition === undefined) {
64
+ alm.transition = 'slide';
65
+ } else if (alm.transition === "fade") {
66
+ alm.transition = 'fade';
67
+ } else {
68
+ alm.transition = 'slide';
69
+ }
70
+
71
+ // Define offset
72
+ if (alm.content.data('offset') === undefined) {
73
+ alm.offset = 0;
74
+ } else {
75
+ alm.offset = alm.content.data('offset');
76
+ }
77
+
78
+ // Define button text
79
+ if (alm.content.data('button-label') === undefined) {
80
+ alm.button_label = 'Older Posts';
81
+ } else {
82
+ alm.button_label = alm.content.data('button-label');
83
+ }
84
+
85
+ // Define on Scroll event
86
+ if (alm.content.data('scroll') === undefined) {
87
+ alm.scroll = true;
88
+ } else if (alm.content.data('scroll') === false) {
89
+ alm.scroll = false;
90
+ } else {
91
+ alm.scroll = true;
92
+ }
93
+
94
+ // Parse multiple Post Types
95
+ alm.post_type = alm.content.data('post-type');
96
+ alm.post_type = alm.post_type.split(",");
97
+
98
+ // Append 'load More' button to .ajax-load-more-wrap
99
+ alm.el.append('<div class="' + alm.prefix + 'btn-wrap"><button id="load-more" class="' + alm.prefix + 'load-more-btn more">' + alm.button_label + '</button></div>');
100
+ alm.button = $('.alm-load-more-btn', alm.el);
101
+
102
+
103
+ /* loadPosts()
104
+ *
105
+ * The function to get posts via Ajax
106
+ * @since 2.0.0
107
+ */
108
+ alm.AjaxLoadMore.loadPosts = function () {
109
+ alm.button.addClass('loading');
110
+ alm.loading = true;
111
+ $.ajax({
112
+ type: "GET",
113
+ url: alm_localize.ajaxurl,
114
+ data: {
115
+ action: 'ajax_load_more_init',
116
+ nonce: alm_localize.alm_nonce,
117
+ repeater: alm.repeater,
118
+ postType: alm.post_type,
119
+ postFormat: alm.content.data('post-format'),
120
+ category: alm.content.data('category'),
121
+ author: alm.content.data('author'),
122
+ taxonomy: alm.content.data('taxonomy'),
123
+ taxonomy_terms: alm.content.data('taxonomy-terms'),
124
+ taxonomy_operator: alm.content.data('taxonomy-operator'),
125
+ meta_key: alm.content.data('meta-key'),
126
+ meta_value: alm.content.data('meta-value'),
127
+ meta_compare: alm.content.data('meta-compare'),
128
+ tag: alm.content.data('tag'),
129
+ order: alm.content.data('order'),
130
+ orderby: alm.content.data('orderby'),
131
+ search: alm.content.data('search'),
132
+ exclude: alm.content.data('exclude'),
133
+ numPosts: alm.content.data('posts-per-page'),
134
+ pageNumber: alm.page,
135
+ offset: alm.offset,
136
+ lang: alm.lang
137
+ },
138
+ dataType: "html",
139
+ // parse the data as html
140
+ beforeSend: function () {
141
+ if (alm.page != 1) {
142
+ alm.button.addClass('loading');
143
+ }
144
+ },
145
+ success: function (data) {
146
+ alm.data = $(data); // Convert data to an object
147
+ //console.log(alm.data.length);
148
+ if (alm.init) {
149
+ alm.button.text(alm.button_label);
150
+ alm.init = false;
151
+ }
152
+ if (alm.data.length > 0) {
153
+ alm.el = $('<div class="' + alm.prefix + 'reveal"/>');
154
+ alm.el.append(alm.data);
155
+ alm.el.hide();
156
+ alm.content.append(alm.el);
157
+ if (alm.transition === 'fade') { // Fade transition
158
+ alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
159
+ alm.loading = false;
160
+ alm.button.delay(alm.speed).removeClass('loading');
161
+ if (alm.data.length < alm.posts_per_page) {
162
+ alm.finished = true;
163
+ alm.button.addClass('done');
164
+ }
165
+ });
166
+ } else { // Slide transition
167
+ alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
168
+ alm.loading = false;
169
+ alm.button.delay(alm.speed).removeClass('loading');
170
+ if (alm.data.length < alm.posts_per_page) {
171
+ alm.finished = true;
172
+ alm.button.addClass('done');
173
+ }
174
+ });
175
+ }
176
+
177
+ if ($.isFunction($.fn.almComplete)) {
178
+ $.fn.almComplete(alm);
179
+ }
180
+
181
+ } else {
182
+ alm.button.delay(alm.speed).removeClass('loading').addClass('done');
183
+ alm.loading = false;
184
+ alm.finished = true;
185
+ }
186
+ },
187
+ error: function (jqXHR, textStatus, errorThrown) {
188
+ alm.loading = false;
189
+ alm.button.removeClass('loading');
190
+ }
191
+ });
192
+ };
193
+
194
+
195
+ /* Button onClick()
196
+ *
197
+ * Load more button click event
198
+ * @since 1.0.0
199
+ */
200
+ alm.button.on('click', function () {
201
+ if (alm.pause === true) {
202
+ alm.pause = false;
203
+ alm.AjaxLoadMore.loadPosts();
204
+ }
205
+ if (!alm.loading && !alm.finished && !$(this).hasClass('done')) {
206
+ alm.loading = true;
207
+ alm.page++;
208
+ alm.AjaxLoadMore.loadPosts();
209
+ }
210
+ });
211
+
212
+
213
+ /* AjaxLoadMore.isVisible()
214
+ *
215
+ * Check to see if element is visible before loading posts
216
+ * @since 2.1.2
217
+ */
218
+ alm.AjaxLoadMore.isVisible = function () {
219
+ alm.visible = false;
220
+ if (alm.el.is(":visible")) {
221
+ alm.visible = true;
222
+ }
223
+ return alm.visible;
224
+ };
225
+
226
+
227
+ /* Window scroll and touchmove events
228
+ *
229
+ * Load posts as user scrolls the page
230
+ * @since 1.0
231
+ */
232
+ if (alm.scroll) {
233
+ alm.window.bind("scroll touchstart", function () {
234
+ if (alm.AjaxLoadMore.isVisible()) {
235
+ var content_offset = alm.button.offset();
236
+ if (!alm.loading && !alm.finished && alm.window.scrollTop() >= Math.round(content_offset.top - (alm.window.height() - 150)) && alm.page < (alm.max_pages - 1) && alm.proceed && !alm.pause) {
237
+ alm.loading = true;
238
+ alm.page++;
239
+ alm.AjaxLoadMore.loadPosts();
240
+ }
241
+ }
242
+ });
243
+ }
244
+
245
+
246
+ //Check for pause variable
247
+ if (alm.pause === true) {
248
+ alm.button.text(alm.button_label);
249
+ alm.loading = false;
250
+ } else {
251
+ alm.AjaxLoadMore.loadPosts();
252
+ }
253
+
254
+
255
+ //flag to prevent unnecessary loading of post on init. Hold for 1 second
256
+ setTimeout(function () {
257
+ alm.proceed = true;
258
+ }, 1000);
259
+
260
+
261
+ //Custom easing function
262
+ $.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
263
+ if ((t /= d / 2) < 1) return c / 2 * t * t + b;
264
+ return -c / 2 * ((--t) * (t - 2) - 1) + b;
265
+ };
266
+ };
267
+
268
+ // End $.ajaxloadmore
269
+
270
+ /* $.fn.ajaxloadmore()
271
+ *
272
+ * Initiate all instances of Ajax load More
273
+ * @since 2.1.2
274
+ */
275
+ $.fn.ajaxloadmore = function () {
276
+ return this.each(function () {
277
+ $(this).data('alm', new $.ajaxloadmore($(this)));
278
+ });
279
+ }
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  /*
282
+ * Initiate Ajax load More if div is present on screen
283
+ * @since 2.1.2
284
+ */
285
+ if ($(".ajax-load-more-wrap").length) $(".ajax-load-more-wrap").ajaxloadmore();
286
+
 
287
  })(jQuery);
core/js/ajax-load-more.min.js CHANGED
@@ -11,4 +11,4 @@
11
  * Twitter: @KaptonKaos
12
  */
13
 
14
- (function(e){"use strict";e.ajaxloadmore=function(t){var n=this;n.AjaxLoadMore={};n.page=0;n.speed=300;n.proceed=false;n.init=true;n.loading=true;n.finished=false;n.window=e(window);n.button_label="";n.data;n.el=t;n.content=e(".alm-listing",n.el);n.scroll=true;n.prefix="alm-";n.repeater=n.content.data("repeater");n.max_pages=n.content.data("max-pages");n.pause=n.content.data("pause");n.offset=n.content.data("offset");n.transition=n.content.data("transition");n.lang=n.content.data("lang"),n.posts_per_page=n.content.data("posts-per-page");e(window).scrollTop(0);if(n.pause===undefined){n.pause=false}if(n.repeater===undefined){n.repeater="default"}if(n.max_pages===undefined){n.max_pages=5}if(n.max_pages==="none"){n.max_pages=1e6}if(n.transition===undefined){n.transition="slide"}else if(n.transition==="fade"){n.transition="fade"}else{n.transition="slide"}if(n.content.data("offset")===undefined){n.offset=0}else{n.offset=n.content.data("offset")}if(n.content.data("button-label")===undefined){n.button_label="Older Posts"}else{n.button_label=n.content.data("button-label")}if(n.content.data("scroll")===undefined){n.scroll=true}else if(n.content.data("scroll")===false){n.scroll=false}else{n.scroll=true}n.post_type=n.content.data("post-type");n.post_type=n.post_type.split(",");n.el.append('<div class="'+n.prefix+'btn-wrap"><button id="load-more" class="'+n.prefix+'load-more-btn more">'+n.button_label+"</button></div>");n.button=e(".alm-load-more-btn",n.el);n.AjaxLoadMore.loadPosts=function(){n.button.addClass("loading");n.loading=true;e.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:"ajax_load_more_init",nonce:alm_localize.alm_nonce,repeater:n.repeater,postType:n.post_type,postFormat:n.content.data("post-format"),category:n.content.data("category"),author:n.content.data("author"),taxonomy:n.content.data("taxonomy"),taxonomy_terms:n.content.data("taxonomy-terms"),taxonomy_operator:n.content.data("taxonomy-operator"),tag:n.content.data("tag"),order:n.content.data("order"),orderby:n.content.data("orderby"),search:n.content.data("search"),exclude:n.content.data("exclude"),numPosts:n.content.data("posts-per-page"),pageNumber:n.page,offset:n.offset,lang:n.lang},dataType:"html",beforeSend:function(){if(n.page!=1){n.button.addClass("loading")}},success:function(t){n.data=e(t);if(n.init){n.button.text(n.button_label);n.init=false}if(n.data.length>0){n.el=e('<div class="'+n.prefix+'reveal"/>');n.el.append(n.data);n.el.hide();n.content.append(n.el);if(n.transition==="fade"){n.el.fadeIn(n.speed,"alm_easeInOutQuad",function(){n.loading=false;n.button.delay(n.speed).removeClass("loading");if(n.data.length<n.posts_per_page){n.finished=true;n.button.addClass("done")}})}else{n.el.slideDown(n.speed,"alm_easeInOutQuad",function(){n.loading=false;n.button.delay(n.speed).removeClass("loading");if(n.data.length<n.posts_per_page){n.finished=true;n.button.addClass("done")}})}if(e.isFunction(e.fn.almComplete)){e.fn.almComplete(n)}}else{n.button.delay(n.speed).removeClass("loading").addClass("done");n.loading=false;n.finished=true}},error:function(e,t,r){n.loading=false;n.button.removeClass("loading")}})};n.button.on("click",function(){if(n.pause===true){n.pause=false;n.AjaxLoadMore.loadPosts()}if(!n.loading&&!n.finished&&!e(this).hasClass("done")){n.loading=true;n.page++;n.AjaxLoadMore.loadPosts()}});n.AjaxLoadMore.isVisible=function(){n.visible=false;if(n.el.is(":visible")){n.visible=true}return n.visible};if(n.scroll){n.window.bind("scroll touchstart",function(){if(n.AjaxLoadMore.isVisible()){var e=n.button.offset();if(!n.loading&&!n.finished&&n.window.scrollTop()>=Math.round(e.top-(n.window.height()-150))&&n.page<n.max_pages-1&&n.proceed){n.loading=true;n.page++;n.AjaxLoadMore.loadPosts()}}})}if(n.pause===true){n.button.text(n.button_label);n.loading=false}else{n.AjaxLoadMore.loadPosts()}setTimeout(function(){n.proceed=true},1e3);e.easing.alm_easeInOutQuad=function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t+n;return-r/2*(--t*(t-2)-1)+n}};e.fn.ajaxloadmore=function(){return this.each(function(){e(this).data("alm",new e.ajaxloadmore(e(this)))})};if(e(".ajax-load-more-wrap").length)e(".ajax-load-more-wrap").ajaxloadmore()})(jQuery)
11
  * Twitter: @KaptonKaos
12
  */
13
 
14
+ (function(e){"use strict";e.ajaxloadmore=function(t){var n=this;n.AjaxLoadMore={};n.page=0;n.speed=300;n.proceed=false;n.init=true;n.loading=true;n.finished=false;n.window=e(window);n.button_label="";n.data;n.el=t;n.content=e(".alm-listing",n.el);n.scroll=true;n.prefix="alm-";n.repeater=n.content.data("repeater");n.max_pages=n.content.data("max-pages");n.pause=n.content.data("pause");n.offset=n.content.data("offset");n.transition=n.content.data("transition");n.lang=n.content.data("lang"),n.posts_per_page=n.content.data("posts-per-page");e(window).scrollTop(0);if(n.pause===undefined){n.pause=false}if(n.repeater===undefined){n.repeater="default"}if(n.max_pages===undefined){n.max_pages=5}if(n.max_pages==="none"){n.max_pages=1e6}if(n.transition===undefined){n.transition="slide"}else if(n.transition==="fade"){n.transition="fade"}else{n.transition="slide"}if(n.content.data("offset")===undefined){n.offset=0}else{n.offset=n.content.data("offset")}if(n.content.data("button-label")===undefined){n.button_label="Older Posts"}else{n.button_label=n.content.data("button-label")}if(n.content.data("scroll")===undefined){n.scroll=true}else if(n.content.data("scroll")===false){n.scroll=false}else{n.scroll=true}n.post_type=n.content.data("post-type");n.post_type=n.post_type.split(",");n.el.append('<div class="'+n.prefix+'btn-wrap"><button id="load-more" class="'+n.prefix+'load-more-btn more">'+n.button_label+"</button></div>");n.button=e(".alm-load-more-btn",n.el);n.AjaxLoadMore.loadPosts=function(){n.button.addClass("loading");n.loading=true;e.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:"ajax_load_more_init",nonce:alm_localize.alm_nonce,repeater:n.repeater,postType:n.post_type,postFormat:n.content.data("post-format"),category:n.content.data("category"),author:n.content.data("author"),taxonomy:n.content.data("taxonomy"),taxonomy_terms:n.content.data("taxonomy-terms"),taxonomy_operator:n.content.data("taxonomy-operator"),meta_key:n.content.data("meta-key"),meta_value:n.content.data("meta-value"),meta_compare:n.content.data("meta-compare"),tag:n.content.data("tag"),order:n.content.data("order"),orderby:n.content.data("orderby"),search:n.content.data("search"),exclude:n.content.data("exclude"),numPosts:n.content.data("posts-per-page"),pageNumber:n.page,offset:n.offset,lang:n.lang},dataType:"html",beforeSend:function(){if(n.page!=1){n.button.addClass("loading")}},success:function(t){n.data=e(t);if(n.init){n.button.text(n.button_label);n.init=false}if(n.data.length>0){n.el=e('<div class="'+n.prefix+'reveal"/>');n.el.append(n.data);n.el.hide();n.content.append(n.el);if(n.transition==="fade"){n.el.fadeIn(n.speed,"alm_easeInOutQuad",function(){n.loading=false;n.button.delay(n.speed).removeClass("loading");if(n.data.length<n.posts_per_page){n.finished=true;n.button.addClass("done")}})}else{n.el.slideDown(n.speed,"alm_easeInOutQuad",function(){n.loading=false;n.button.delay(n.speed).removeClass("loading");if(n.data.length<n.posts_per_page){n.finished=true;n.button.addClass("done")}})}if(e.isFunction(e.fn.almComplete)){e.fn.almComplete(n)}}else{n.button.delay(n.speed).removeClass("loading").addClass("done");n.loading=false;n.finished=true}},error:function(e,t,r){n.loading=false;n.button.removeClass("loading")}})};n.button.on("click",function(){if(n.pause===true){n.pause=false;n.AjaxLoadMore.loadPosts()}if(!n.loading&&!n.finished&&!e(this).hasClass("done")){n.loading=true;n.page++;n.AjaxLoadMore.loadPosts()}});n.AjaxLoadMore.isVisible=function(){n.visible=false;if(n.el.is(":visible")){n.visible=true}return n.visible};if(n.scroll){n.window.bind("scroll touchstart",function(){if(n.AjaxLoadMore.isVisible()){var e=n.button.offset();if(!n.loading&&!n.finished&&n.window.scrollTop()>=Math.round(e.top-(n.window.height()-150))&&n.page<n.max_pages-1&&n.proceed&&!n.pause){n.loading=true;n.page++;n.AjaxLoadMore.loadPosts()}}})}if(n.pause===true){n.button.text(n.button_label);n.loading=false}else{n.AjaxLoadMore.loadPosts()}setTimeout(function(){n.proceed=true},1e3);e.easing.alm_easeInOutQuad=function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t+n;return-r/2*(--t*(t-2)-1)+n}};e.fn.ajaxloadmore=function(){return this.each(function(){e(this).data("alm",new e.ajaxloadmore(e(this)))})};if(e(".ajax-load-more-wrap").length)e(".ajax-load-more-wrap").ajaxloadmore()})(jQuery)
lang/ajax-load-more.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ajax Load More\n"
4
- "POT-Creation-Date: 2014-09-11 22:32-0500\n"
5
- "PO-Revision-Date: 2014-09-11 22:32-0500\n"
6
  "Last-Translator: Darren Cooney <darren.cooney@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: en_CA\n"
@@ -31,99 +31,114 @@ msgstr ""
31
  msgid "Expand All"
32
  msgstr ""
33
 
34
- #: ../admin/admin.php:259
35
  msgid "Default Template"
36
  msgstr ""
37
 
38
- #: ../admin/admin.php:262
39
  msgid "Enter the HTML and PHP code for the default template"
40
  msgstr ""
41
 
42
- #: ../admin/admin.php:276
43
  msgid "Save Template"
44
  msgstr ""
45
 
46
- #: ../admin/admin.php:343
47
- msgid "Saving data..."
48
- msgstr ""
49
-
50
- #: ../admin/admin.php:356
51
- msgid "Template saved successfully"
52
  msgstr ""
53
 
54
- #: ../admin/admin.php:364
55
- msgid "Something went wrong and the data could not be saved"
56
  msgstr ""
57
 
58
- #: ../admin/admin.php:385
59
  msgid "Templating Help"
60
  msgstr ""
61
 
62
- #: ../admin/admin.php:387
63
  msgid "What is a repeater template?"
64
  msgstr ""
65
 
66
- #: ../admin/admin.php:388
67
  msgid ""
68
  "A repeater template is a snippet of code that will execute over and over "
69
  "within a <a href=\"http://codex.wordpress.org/The_Loop\" target=\"_blank"
70
  "\">WordPress loop</a>.</p>"
71
  msgstr ""
72
 
73
- #: ../admin/admin.php:391
74
  msgid "Can I include PHP in the repeater template?"
75
  msgstr ""
76
 
77
- #: ../admin/admin.php:392
78
  msgid ""
79
  "Yes, PHP and core WordPress functions such as, <code>the_title()</code> and "
80
  "<code>the_permalink()</code> are required.</p>"
81
  msgstr ""
82
 
83
- #: ../admin/admin.php:395
84
  msgid "Tips and Tricks"
85
  msgstr ""
86
 
87
- #: ../admin/admin.php:397
88
  msgid ""
89
  "Always open and close your templates with an HTML element. In some rare "
90
  "cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code>&lt;"
91
  "li> &lt;/li></code> or <code>&lt;div> &lt;/div></code>"
92
  msgstr ""
93
 
94
- #: ../admin/admin.php:468
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  msgid "Ajax Load More: Shortcode Builder"
96
  msgstr ""
97
 
98
- #: ../admin/admin.php:469
99
  msgid ""
100
  "Create your own Ajax Load More <a href=\"http://en.support.wordpress.com/"
101
  "shortcodes/\" target=\"_blank\">shortcode</a> by adjusting the values below"
102
  msgstr ""
103
 
104
- #: ../admin/admin.php:475 ../admin/admin.php:589
105
  msgid "Back to Top"
106
  msgstr ""
107
 
108
- #: ../admin/admin.php:481
109
  msgid "Shortcode Output"
110
  msgstr ""
111
 
112
- #: ../admin/admin.php:482
113
  msgid ""
114
  "Copy and paste the following shortcode into the content editor or widget "
115
  "area of your theme."
116
  msgstr ""
117
 
118
- #: ../admin/admin.php:485 ../admin/editor-build.php:45
119
  msgid "Copy"
120
  msgstr ""
121
 
122
- #: ../admin/admin.php:489
123
  msgid "Did you know?"
124
  msgstr ""
125
 
126
- #: ../admin/admin.php:491
127
  msgid ""
128
  "<p class=\"addon-intro\">You can generate shortcodes while editing pages!</"
129
  "p><p>Click the Ajax Load More icon in the content editor toolbar and the <a "
@@ -131,78 +146,78 @@ msgid ""
131
  "open in an overlay window."
132
  msgstr ""
133
 
134
- #: ../admin/admin.php:548
135
  msgid "Ajax Load More: Examples"
136
  msgstr ""
137
 
138
- #: ../admin/admin.php:549
139
  msgid "A collection of everyday shortcode usages and implementation examples"
140
  msgstr ""
141
 
142
- #: ../admin/admin.php:554
143
  msgid "Author.php"
144
  msgstr ""
145
 
146
- #: ../admin/admin.php:556
147
  msgid "Shortcode for use on author archive pages."
148
  msgstr ""
149
 
150
- #: ../admin/admin.php:563
151
  msgid "Category.php"
152
  msgstr ""
153
 
154
- #: ../admin/admin.php:565
155
  msgid "Shortcode for use on category archive pages."
156
  msgstr ""
157
 
158
- #: ../admin/admin.php:572
159
  msgid "Excluding Posts"
160
  msgstr ""
161
 
162
- #: ../admin/admin.php:574
163
  msgid "Shortcode for excluding an array of posts."
164
  msgstr ""
165
 
166
- #: ../admin/admin.php:580
167
  msgid "Tag.php"
168
  msgstr ""
169
 
170
- #: ../admin/admin.php:582
171
  msgid "Shortcode for use on tag archive pages."
172
  msgstr ""
173
 
174
- #: ../admin/admin.php:595
175
  msgid "Request Examples"
176
  msgstr ""
177
 
178
- #: ../admin/admin.php:596
179
  msgid ""
180
  "If you're having issue's with functionality, please submit example requests "
181
  "through the <a href=\"https://github.com/dcooney/wordpress-ajax-load-more\" "
182
  "target=\"_blank\">GitHub repository</a>. "
183
  msgstr ""
184
 
185
- #: ../admin/admin.php:620
186
  msgid "Ajax Load More: Add-ons"
187
  msgstr ""
188
 
189
- #: ../admin/admin.php:621
190
  msgid ""
191
  "The following Add-ons are available to increase the functionality of Ajax "
192
  "Load More."
193
  msgstr ""
194
 
195
- #: ../admin/admin.php:627
196
  msgid "Custom Repeaters"
197
  msgstr ""
198
 
199
- #: ../admin/admin.php:633
200
  msgid ""
201
  "Unlock additional repeater templates and keep your WordPress theme looking "
202
  "and feeling fresh."
203
  msgstr ""
204
 
205
- #: ../admin/admin.php:634
206
  msgid ""
207
  "The Custom Repeaters add-on will add <strong>five</strong> additional <a "
208
  "href=\"?page=ajax-load-more-repeaters\">repeaters</a> and allow you to "
@@ -210,67 +225,67 @@ msgid ""
210
  "p>"
211
  msgstr ""
212
 
213
- #: ../admin/admin.php:651 ../admin/admin.php:655
214
  msgid "About Add-ons"
215
  msgstr ""
216
 
217
- #: ../admin/admin.php:652 ../admin/admin.php:656
218
  msgid ""
219
  "Add-ons are installed as a separate plugin and will receive plug-in update "
220
  "notifications. "
221
  msgstr ""
222
 
223
- #: ../admin/admin.php:698
224
  msgid "Container Type"
225
  msgstr ""
226
 
227
- #: ../admin/admin.php:706
228
  msgid "Container Classes"
229
  msgstr ""
230
 
231
- #: ../admin/admin.php:714
232
  msgid "Editor Shortcode Button"
233
  msgstr ""
234
 
235
- #: ../admin/admin.php:722
236
  msgid "Disable CSS"
237
  msgstr ""
238
 
239
- #: ../admin/admin.php:730
240
  msgid "Button Color"
241
  msgstr ""
242
 
243
- #: ../admin/admin.php:747
244
  msgid ""
245
  "Customize your version of Ajax Load More by updating the fields below.</p><p "
246
  "class=\"small\">All changes will be applied globally throughout your theme."
247
  msgstr ""
248
 
249
- #: ../admin/admin.php:776
250
  msgid "I want to use my own CSS styles"
251
  msgstr ""
252
 
253
- #: ../admin/admin.php:777
254
  msgid "View Ajax Load More CSS"
255
  msgstr ""
256
 
257
- #: ../admin/admin.php:796
258
- msgid "Disable shortcode button from content editors"
259
  msgstr ""
260
 
261
- #: ../admin/admin.php:810
262
  msgid "Add classes to Ajax Load More container"
263
  msgstr ""
264
 
265
- #: ../admin/admin.php:829 ../admin/admin.php:832
266
  msgid "Ajax Posts Here"
267
  msgstr ""
268
 
269
- #: ../admin/admin.php:883
270
  msgid "Choose your load more button color"
271
  msgstr ""
272
 
273
- #: ../admin/admin.php:894
274
  msgid "Preview"
275
  msgstr ""
276
 
@@ -327,12 +342,12 @@ msgstr ""
327
  msgid "Read/Write Access"
328
  msgstr ""
329
 
330
- #: ../admin/includes/cta/writeable.php:8
331
- msgid "Write Access Enabled!"
332
  msgstr ""
333
 
334
- #: ../admin/includes/cta/writeable.php:10
335
- msgid "Write Access Denied!"
336
  msgstr ""
337
 
338
  #: ../admin/shortcode-builder/shortcode-builder.php:8
@@ -415,125 +430,156 @@ msgstr ""
415
  msgid "Taxonomy Operator:"
416
  msgstr ""
417
 
 
 
 
 
418
  #: ../admin/shortcode-builder/shortcode-builder.php:167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  msgid "Author"
420
  msgstr ""
421
 
422
- #: ../admin/shortcode-builder/shortcode-builder.php:170
423
  msgid "Select an Author to query(by ID)."
424
  msgstr ""
425
 
426
- #: ../admin/shortcode-builder/shortcode-builder.php:173
427
  msgid "Select Author"
428
  msgstr ""
429
 
430
- #: ../admin/shortcode-builder/shortcode-builder.php:185
431
  msgid "Search Term"
432
  msgstr ""
433
 
434
- #: ../admin/shortcode-builder/shortcode-builder.php:188
435
  msgid "Enter a search term to query."
436
  msgstr ""
437
 
438
- #: ../admin/shortcode-builder/shortcode-builder.php:192
439
  msgid "Enter search term"
440
  msgstr ""
441
 
442
- #: ../admin/shortcode-builder/shortcode-builder.php:200
443
  msgid "Ordering"
444
  msgstr ""
445
 
446
- #: ../admin/shortcode-builder/shortcode-builder.php:203
447
  msgid "Sort retrieved posts by Order and Orderby parameters."
448
  msgstr ""
449
 
450
- #: ../admin/shortcode-builder/shortcode-builder.php:232
451
  msgid "Exclude"
452
  msgstr ""
453
 
454
- #: ../admin/shortcode-builder/shortcode-builder.php:235
455
  msgid "A comma separated list of post ID's to exclude from query."
456
  msgstr ""
457
 
458
- #: ../admin/shortcode-builder/shortcode-builder.php:247
459
  msgid "Offset"
460
  msgstr ""
461
 
462
- #: ../admin/shortcode-builder/shortcode-builder.php:250
463
  msgid "Offset the initial WordPress query by <em>'n'</em> number of posts"
464
  msgstr ""
465
 
466
- #: ../admin/shortcode-builder/shortcode-builder.php:271
467
  msgid "Posts Per Page"
468
  msgstr ""
469
 
470
- #: ../admin/shortcode-builder/shortcode-builder.php:274
471
  msgid "Select the number of posts to load with each request."
472
  msgstr ""
473
 
474
- #: ../admin/shortcode-builder/shortcode-builder.php:300
475
  msgid "Load Posts on Scroll"
476
  msgstr ""
477
 
478
- #: ../admin/shortcode-builder/shortcode-builder.php:303
479
  msgid "Load more posts as the user scrolls the page."
480
  msgstr ""
481
 
482
- #: ../admin/shortcode-builder/shortcode-builder.php:310
483
- #: ../admin/shortcode-builder/shortcode-builder.php:365
484
  msgid "True"
485
  msgstr ""
486
 
487
- #: ../admin/shortcode-builder/shortcode-builder.php:314
488
- #: ../admin/shortcode-builder/shortcode-builder.php:369
489
  msgid "False"
490
  msgstr ""
491
 
492
- #: ../admin/shortcode-builder/shortcode-builder.php:325
493
  msgid "Max Pages"
494
  msgstr ""
495
 
496
- #: ../admin/shortcode-builder/shortcode-builder.php:328
497
  msgid "Maximum number of pages to load while scrolling."
498
  msgstr ""
499
 
500
- #: ../admin/shortcode-builder/shortcode-builder.php:343
501
  msgid "Unlimited"
502
  msgstr ""
503
 
504
- #: ../admin/shortcode-builder/shortcode-builder.php:355
505
  msgid "Pause Loading of Posts"
506
  msgstr ""
507
 
508
- #: ../admin/shortcode-builder/shortcode-builder.php:358
509
  msgid "Do not load posts until user clicks <em>load</em> button."
510
  msgstr ""
511
 
512
- #: ../admin/shortcode-builder/shortcode-builder.php:380
513
  msgid "Transition"
514
  msgstr ""
515
 
516
- #: ../admin/shortcode-builder/shortcode-builder.php:383
517
  msgid "Select a loading transition."
518
  msgstr ""
519
 
520
- #: ../admin/shortcode-builder/shortcode-builder.php:390
521
  msgid "Slide"
522
  msgstr ""
523
 
524
- #: ../admin/shortcode-builder/shortcode-builder.php:394
525
  msgid "Fade"
526
  msgstr ""
527
 
528
- #: ../admin/shortcode-builder/shortcode-builder.php:405
529
  msgid "Button Label"
530
  msgstr ""
531
 
532
- #: ../admin/shortcode-builder/shortcode-builder.php:408
533
  msgid "Customize the <em>Load More</em> button label."
534
  msgstr ""
535
 
536
- #: ../admin/shortcode-builder/shortcode-builder.php:412
537
  msgid "Older Posts"
538
  msgstr ""
539
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Ajax Load More\n"
4
+ "POT-Creation-Date: 2014-10-06 11:29-0500\n"
5
+ "PO-Revision-Date: 2014-10-06 11:29-0500\n"
6
  "Last-Translator: Darren Cooney <darren.cooney@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: en_CA\n"
31
  msgid "Expand All"
32
  msgstr ""
33
 
34
+ #: ../admin/admin.php:262
35
  msgid "Default Template"
36
  msgstr ""
37
 
38
+ #: ../admin/admin.php:265
39
  msgid "Enter the HTML and PHP code for the default template"
40
  msgstr ""
41
 
42
+ #: ../admin/admin.php:279
43
  msgid "Save Template"
44
  msgstr ""
45
 
46
+ #: ../admin/admin.php:335
47
+ msgid "Saving template..."
 
 
 
 
48
  msgstr ""
49
 
50
+ #: ../admin/admin.php:363
51
+ msgid "Something went wrong and the data could not be saved."
52
  msgstr ""
53
 
54
+ #: ../admin/admin.php:386
55
  msgid "Templating Help"
56
  msgstr ""
57
 
58
+ #: ../admin/admin.php:388
59
  msgid "What is a repeater template?"
60
  msgstr ""
61
 
62
+ #: ../admin/admin.php:389
63
  msgid ""
64
  "A repeater template is a snippet of code that will execute over and over "
65
  "within a <a href=\"http://codex.wordpress.org/The_Loop\" target=\"_blank"
66
  "\">WordPress loop</a>.</p>"
67
  msgstr ""
68
 
69
+ #: ../admin/admin.php:392
70
  msgid "Can I include PHP in the repeater template?"
71
  msgstr ""
72
 
73
+ #: ../admin/admin.php:393
74
  msgid ""
75
  "Yes, PHP and core WordPress functions such as, <code>the_title()</code> and "
76
  "<code>the_permalink()</code> are required.</p>"
77
  msgstr ""
78
 
79
+ #: ../admin/admin.php:396
80
  msgid "Tips and Tricks"
81
  msgstr ""
82
 
83
+ #: ../admin/admin.php:398
84
  msgid ""
85
  "Always open and close your templates with an HTML element. In some rare "
86
  "cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code>&lt;"
87
  "li> &lt;/li></code> or <code>&lt;div> &lt;/div></code>"
88
  msgstr ""
89
 
90
+ #: ../admin/admin.php:434
91
+ msgid "Error Opening File"
92
+ msgstr ""
93
+
94
+ #: ../admin/admin.php:436 ../admin/admin.php:440
95
+ msgid ""
96
+ "Please check your file path and ensure your server is configured to allow "
97
+ "Ajax Load More to read and write files within the /ajax-load-more/ plugin "
98
+ "directory"
99
+ msgstr ""
100
+
101
+ #: ../admin/admin.php:438
102
+ msgid "Error Saving File"
103
+ msgstr ""
104
+
105
+ #: ../admin/admin.php:466
106
+ msgid "Error Writing File"
107
+ msgstr ""
108
+
109
+ #: ../admin/admin.php:483
110
  msgid "Ajax Load More: Shortcode Builder"
111
  msgstr ""
112
 
113
+ #: ../admin/admin.php:484
114
  msgid ""
115
  "Create your own Ajax Load More <a href=\"http://en.support.wordpress.com/"
116
  "shortcodes/\" target=\"_blank\">shortcode</a> by adjusting the values below"
117
  msgstr ""
118
 
119
+ #: ../admin/admin.php:490 ../admin/admin.php:604
120
  msgid "Back to Top"
121
  msgstr ""
122
 
123
+ #: ../admin/admin.php:496
124
  msgid "Shortcode Output"
125
  msgstr ""
126
 
127
+ #: ../admin/admin.php:497
128
  msgid ""
129
  "Copy and paste the following shortcode into the content editor or widget "
130
  "area of your theme."
131
  msgstr ""
132
 
133
+ #: ../admin/admin.php:500 ../admin/editor-build.php:45
134
  msgid "Copy"
135
  msgstr ""
136
 
137
+ #: ../admin/admin.php:504
138
  msgid "Did you know?"
139
  msgstr ""
140
 
141
+ #: ../admin/admin.php:506
142
  msgid ""
143
  "<p class=\"addon-intro\">You can generate shortcodes while editing pages!</"
144
  "p><p>Click the Ajax Load More icon in the content editor toolbar and the <a "
146
  "open in an overlay window."
147
  msgstr ""
148
 
149
+ #: ../admin/admin.php:563
150
  msgid "Ajax Load More: Examples"
151
  msgstr ""
152
 
153
+ #: ../admin/admin.php:564
154
  msgid "A collection of everyday shortcode usages and implementation examples"
155
  msgstr ""
156
 
157
+ #: ../admin/admin.php:569
158
  msgid "Author.php"
159
  msgstr ""
160
 
161
+ #: ../admin/admin.php:571
162
  msgid "Shortcode for use on author archive pages."
163
  msgstr ""
164
 
165
+ #: ../admin/admin.php:578
166
  msgid "Category.php"
167
  msgstr ""
168
 
169
+ #: ../admin/admin.php:580
170
  msgid "Shortcode for use on category archive pages."
171
  msgstr ""
172
 
173
+ #: ../admin/admin.php:587
174
  msgid "Excluding Posts"
175
  msgstr ""
176
 
177
+ #: ../admin/admin.php:589
178
  msgid "Shortcode for excluding an array of posts."
179
  msgstr ""
180
 
181
+ #: ../admin/admin.php:595
182
  msgid "Tag.php"
183
  msgstr ""
184
 
185
+ #: ../admin/admin.php:597
186
  msgid "Shortcode for use on tag archive pages."
187
  msgstr ""
188
 
189
+ #: ../admin/admin.php:610
190
  msgid "Request Examples"
191
  msgstr ""
192
 
193
+ #: ../admin/admin.php:611
194
  msgid ""
195
  "If you're having issue's with functionality, please submit example requests "
196
  "through the <a href=\"https://github.com/dcooney/wordpress-ajax-load-more\" "
197
  "target=\"_blank\">GitHub repository</a>. "
198
  msgstr ""
199
 
200
+ #: ../admin/admin.php:635
201
  msgid "Ajax Load More: Add-ons"
202
  msgstr ""
203
 
204
+ #: ../admin/admin.php:636
205
  msgid ""
206
  "The following Add-ons are available to increase the functionality of Ajax "
207
  "Load More."
208
  msgstr ""
209
 
210
+ #: ../admin/admin.php:642
211
  msgid "Custom Repeaters"
212
  msgstr ""
213
 
214
+ #: ../admin/admin.php:648
215
  msgid ""
216
  "Unlock additional repeater templates and keep your WordPress theme looking "
217
  "and feeling fresh."
218
  msgstr ""
219
 
220
+ #: ../admin/admin.php:649
221
  msgid ""
222
  "The Custom Repeaters add-on will add <strong>five</strong> additional <a "
223
  "href=\"?page=ajax-load-more-repeaters\">repeaters</a> and allow you to "
225
  "p>"
226
  msgstr ""
227
 
228
+ #: ../admin/admin.php:666 ../admin/admin.php:670
229
  msgid "About Add-ons"
230
  msgstr ""
231
 
232
+ #: ../admin/admin.php:667 ../admin/admin.php:671
233
  msgid ""
234
  "Add-ons are installed as a separate plugin and will receive plug-in update "
235
  "notifications. "
236
  msgstr ""
237
 
238
+ #: ../admin/admin.php:706
239
  msgid "Container Type"
240
  msgstr ""
241
 
242
+ #: ../admin/admin.php:714
243
  msgid "Container Classes"
244
  msgstr ""
245
 
246
+ #: ../admin/admin.php:722
247
  msgid "Editor Shortcode Button"
248
  msgstr ""
249
 
250
+ #: ../admin/admin.php:730
251
  msgid "Disable CSS"
252
  msgstr ""
253
 
254
+ #: ../admin/admin.php:738
255
  msgid "Button Color"
256
  msgstr ""
257
 
258
+ #: ../admin/admin.php:755
259
  msgid ""
260
  "Customize your version of Ajax Load More by updating the fields below.</p><p "
261
  "class=\"small\">All changes will be applied globally throughout your theme."
262
  msgstr ""
263
 
264
+ #: ../admin/admin.php:784
265
  msgid "I want to use my own CSS styles"
266
  msgstr ""
267
 
268
+ #: ../admin/admin.php:785
269
  msgid "View Ajax Load More CSS"
270
  msgstr ""
271
 
272
+ #: ../admin/admin.php:804
273
+ msgid "Hide shortcode button in WYSIWYG editor"
274
  msgstr ""
275
 
276
+ #: ../admin/admin.php:818
277
  msgid "Add classes to Ajax Load More container"
278
  msgstr ""
279
 
280
+ #: ../admin/admin.php:837 ../admin/admin.php:840
281
  msgid "Ajax Posts Here"
282
  msgstr ""
283
 
284
+ #: ../admin/admin.php:891
285
  msgid "Choose your load more button color"
286
  msgstr ""
287
 
288
+ #: ../admin/admin.php:902
289
  msgid "Preview"
290
  msgstr ""
291
 
342
  msgid "Read/Write Access"
343
  msgstr ""
344
 
345
+ #: ../admin/includes/cta/writeable.php:9
346
+ msgid "Read/Write Access Enabled"
347
  msgstr ""
348
 
349
+ #: ../admin/includes/cta/writeable.php:11
350
+ msgid "Access Denied"
351
  msgstr ""
352
 
353
  #: ../admin/shortcode-builder/shortcode-builder.php:8
430
  msgid "Taxonomy Operator:"
431
  msgstr ""
432
 
433
+ #: ../admin/shortcode-builder/shortcode-builder.php:164
434
+ msgid "Custom Fields (Meta)"
435
+ msgstr ""
436
+
437
  #: ../admin/shortcode-builder/shortcode-builder.php:167
438
+ msgid ""
439
+ "Query by <a href=\"http://codex.wordpress.org/Class_Reference/WP_Meta_Query"
440
+ "\" target=\"_blank\">custom fields</a>. Enter your key(name) and value, "
441
+ "then select your operator."
442
+ msgstr ""
443
+
444
+ #: ../admin/shortcode-builder/shortcode-builder.php:172
445
+ msgid "Field Key (Name):"
446
+ msgstr ""
447
+
448
+ #: ../admin/shortcode-builder/shortcode-builder.php:173
449
+ msgid "field_name"
450
+ msgstr ""
451
+
452
+ #: ../admin/shortcode-builder/shortcode-builder.php:179
453
+ msgid "Field Value:"
454
+ msgstr ""
455
+
456
+ #: ../admin/shortcode-builder/shortcode-builder.php:180
457
+ msgid "field_value"
458
+ msgstr ""
459
+
460
+ #: ../admin/shortcode-builder/shortcode-builder.php:184
461
+ msgid "Field Operator:"
462
+ msgstr ""
463
+
464
+ #: ../admin/shortcode-builder/shortcode-builder.php:212
465
  msgid "Author"
466
  msgstr ""
467
 
468
+ #: ../admin/shortcode-builder/shortcode-builder.php:215
469
  msgid "Select an Author to query(by ID)."
470
  msgstr ""
471
 
472
+ #: ../admin/shortcode-builder/shortcode-builder.php:218
473
  msgid "Select Author"
474
  msgstr ""
475
 
476
+ #: ../admin/shortcode-builder/shortcode-builder.php:230
477
  msgid "Search Term"
478
  msgstr ""
479
 
480
+ #: ../admin/shortcode-builder/shortcode-builder.php:233
481
  msgid "Enter a search term to query."
482
  msgstr ""
483
 
484
+ #: ../admin/shortcode-builder/shortcode-builder.php:237
485
  msgid "Enter search term"
486
  msgstr ""
487
 
488
+ #: ../admin/shortcode-builder/shortcode-builder.php:245
489
  msgid "Ordering"
490
  msgstr ""
491
 
492
+ #: ../admin/shortcode-builder/shortcode-builder.php:248
493
  msgid "Sort retrieved posts by Order and Orderby parameters."
494
  msgstr ""
495
 
496
+ #: ../admin/shortcode-builder/shortcode-builder.php:277
497
  msgid "Exclude"
498
  msgstr ""
499
 
500
+ #: ../admin/shortcode-builder/shortcode-builder.php:280
501
  msgid "A comma separated list of post ID's to exclude from query."
502
  msgstr ""
503
 
504
+ #: ../admin/shortcode-builder/shortcode-builder.php:292
505
  msgid "Offset"
506
  msgstr ""
507
 
508
+ #: ../admin/shortcode-builder/shortcode-builder.php:295
509
  msgid "Offset the initial WordPress query by <em>'n'</em> number of posts"
510
  msgstr ""
511
 
512
+ #: ../admin/shortcode-builder/shortcode-builder.php:316
513
  msgid "Posts Per Page"
514
  msgstr ""
515
 
516
+ #: ../admin/shortcode-builder/shortcode-builder.php:319
517
  msgid "Select the number of posts to load with each request."
518
  msgstr ""
519
 
520
+ #: ../admin/shortcode-builder/shortcode-builder.php:345
521
  msgid "Load Posts on Scroll"
522
  msgstr ""
523
 
524
+ #: ../admin/shortcode-builder/shortcode-builder.php:348
525
  msgid "Load more posts as the user scrolls the page."
526
  msgstr ""
527
 
528
+ #: ../admin/shortcode-builder/shortcode-builder.php:355
529
+ #: ../admin/shortcode-builder/shortcode-builder.php:410
530
  msgid "True"
531
  msgstr ""
532
 
533
+ #: ../admin/shortcode-builder/shortcode-builder.php:359
534
+ #: ../admin/shortcode-builder/shortcode-builder.php:414
535
  msgid "False"
536
  msgstr ""
537
 
538
+ #: ../admin/shortcode-builder/shortcode-builder.php:370
539
  msgid "Max Pages"
540
  msgstr ""
541
 
542
+ #: ../admin/shortcode-builder/shortcode-builder.php:373
543
  msgid "Maximum number of pages to load while scrolling."
544
  msgstr ""
545
 
546
+ #: ../admin/shortcode-builder/shortcode-builder.php:388
547
  msgid "Unlimited"
548
  msgstr ""
549
 
550
+ #: ../admin/shortcode-builder/shortcode-builder.php:400
551
  msgid "Pause Loading of Posts"
552
  msgstr ""
553
 
554
+ #: ../admin/shortcode-builder/shortcode-builder.php:403
555
  msgid "Do not load posts until user clicks <em>load</em> button."
556
  msgstr ""
557
 
558
+ #: ../admin/shortcode-builder/shortcode-builder.php:425
559
  msgid "Transition"
560
  msgstr ""
561
 
562
+ #: ../admin/shortcode-builder/shortcode-builder.php:428
563
  msgid "Select a loading transition."
564
  msgstr ""
565
 
566
+ #: ../admin/shortcode-builder/shortcode-builder.php:435
567
  msgid "Slide"
568
  msgstr ""
569
 
570
+ #: ../admin/shortcode-builder/shortcode-builder.php:439
571
  msgid "Fade"
572
  msgstr ""
573
 
574
+ #: ../admin/shortcode-builder/shortcode-builder.php:450
575
  msgid "Button Label"
576
  msgstr ""
577
 
578
+ #: ../admin/shortcode-builder/shortcode-builder.php:453
579
  msgid "Customize the <em>Load More</em> button label."
580
  msgstr ""
581
 
582
+ #: ../admin/shortcode-builder/shortcode-builder.php:457
583
  msgid "Older Posts"
584
  msgstr ""
585