WordPress Infinite Scroll – Ajax Load More - Version 2.11.2

Version Description

  • August 4, 2016 =
  • SECURITY - Security fix for Custom Repeaters and Theme Repeaters include file path.
  • FIX - Removed duplicate #ajax-load-more id's being generated when using multiple instances. #ajax-load-more will now only be attached to the 1st instance of the shortcode - please update your CSS if you are targeting the #ajax-load-more ID.
  • FIX - Updated code used to split pages with Search Engine Optimization add-on.
  • FIX - Issue where SEO License key input was not displaying for some users.
  • FIX - Issue for double popstate trigger with Paging + SEO add-on.
  • UPDATE - Various code improvements.
  • NEW - Adding functionality for upcoming Call to Actions add-on.
Download this release

Release Info

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

Code changes from version 2.11.1 to 2.11.2

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: dcooney
3
  Donate link: https://connekthq.com/donate/
4
  Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling, woocommerce
5
  Requires at least: 3.6
6
- Tested up to: 4.5.2
7
- Stable tag: 2.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -51,7 +51,6 @@ Check out the examples below:
51
  Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your custom shortcode is simple with the intuitive [Shortcode Builder](https://connekthq.com/plugins/ajax-load-more/screenshots/#shortcode-builder)
52
 
53
  * **repeater** - Choose a repeater template (<a href="https://connekthq.com/plugins/ajax-load-more/custom-repeaters/">Add-on available</a>). Default = ‘default’
54
- * **theme_repeater** - Select from a list of template files in your current theme directory (<a href="https://connekthq.com/plugins/ajax-load-more/add-ons/theme-repeaters/">Add-on only</a>). Default = null
55
  * **post_type** - Comma separated list of post types. Default = ‘post’
56
  * **post_format** - Query by post format. Default = null
57
  * **category** - A comma separated list of categories to include by slug. Default = null
@@ -95,17 +94,6 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
95
  * **button_loading_label** - Update the text of the Load More button while content is loading. Default = null
96
  * **container_type** - Override the global Container Type that was set on ALM Settings page. Default = null
97
  * **css_classes** - Add custom CSS classes to the Ajax Load More container. Default = null
98
- * **cache** - Turn on content caching for the specific Ajax Load More query. <a href="https://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - (true/false). Default = ‘false’
99
- * **cache_id** - A unique 10 digit ID for the cached query. <a href="https://connekthq.com/plugins/ajax-load-more/cache/">add-on only</a> - Default = A random 10 digit integer
100
- * **seo** - Enable address bar URL rewrites as users page through content - <a href="https://connekthq.com/plugins/ajax-load-more/search-engine-optimization/">add-on only</a> (true/false). Default = ‘false’
101
- * **preloaded** - Should Ajax Load More preload posts? <a href="https://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - (true/false). Default = ‘false’
102
- * **preloaded_amount** - The amount of posts to preload. <a href="https://connekthq.com/plugins/ajax-load-more/preloaded/">add-on only</a> - Default = ‘5’
103
- * **paging** - Replace infinite scrolling with a paged navigation system. <a href="https://connekthq.com/plugins/ajax-load-more/paging/">add-on only</a> (true/false). Default = ‘false’
104
- * **paging_controls** - Show previous(«) and next(») buttons (true/false). Default = ‘false’
105
- * **paging_classes** - Add classes to the paging navigation menu for CSS styling.
106
- * **paging_show_at_most** - Maximum amount of pages to show at a time. 0 = no maximum. Default = ‘0’
107
-
108
-
109
  ***
110
 
111
  = Example Shortcode =
@@ -330,10 +318,20 @@ How to install Ajax Load More.
330
 
331
  == Changelog ==
332
 
 
 
 
 
 
 
 
 
 
 
333
  = 2.11.1 - May 30, 2016 =
334
  * SECURITY - Security fix for posts_status parameter. posts_status is now only available for logged in (admin) users. Non logged in users will only have access to view content in a 'publish' state.
335
  * UPDATE - Added support for preloading comments with the Comments and Preloaded add-ons.
336
- * Shortcode Builder UI improvments
337
 
338
 
339
  = 2.11.0 - May 25, 2016 =
3
  Donate link: https://connekthq.com/donate/
4
  Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling, woocommerce
5
  Requires at least: 3.6
6
+ Tested up to: 4.6
7
+ Stable tag: 2.11.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
51
  Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your custom shortcode is simple with the intuitive [Shortcode Builder](https://connekthq.com/plugins/ajax-load-more/screenshots/#shortcode-builder)
52
 
53
  * **repeater** - Choose a repeater template (<a href="https://connekthq.com/plugins/ajax-load-more/custom-repeaters/">Add-on available</a>). Default = ‘default’
 
54
  * **post_type** - Comma separated list of post types. Default = ‘post’
55
  * **post_format** - Query by post format. Default = null
56
  * **category** - A comma separated list of categories to include by slug. Default = null
94
  * **button_loading_label** - Update the text of the Load More button while content is loading. Default = null
95
  * **container_type** - Override the global Container Type that was set on ALM Settings page. Default = null
96
  * **css_classes** - Add custom CSS classes to the Ajax Load More container. Default = null
 
 
 
 
 
 
 
 
 
 
 
97
  ***
98
 
99
  = Example Shortcode =
318
 
319
  == Changelog ==
320
 
321
+ = 2.11.2 - August 4, 2016 =
322
+ * SECURITY - Security fix for Custom Repeaters and Theme Repeaters include file path.
323
+ * FIX - Removed duplicate #ajax-load-more id's being generated when using multiple instances. #ajax-load-more will now only be attached to the 1st instance of the shortcode - please update your CSS if you are targeting the #ajax-load-more ID.
324
+ * FIX - Updated code used to split pages with Search Engine Optimization add-on.
325
+ * FIX - Issue where SEO License key input was not displaying for some users.
326
+ * FIX - Issue for double popstate trigger with Paging + SEO add-on.
327
+ * UPDATE - Various code improvements.
328
+ * NEW - Adding functionality for upcoming Call to Actions add-on.
329
+
330
+
331
  = 2.11.1 - May 30, 2016 =
332
  * SECURITY - Security fix for posts_status parameter. posts_status is now only available for logged in (admin) users. Non logged in users will only have access to view content in a 'publish' state.
333
  * UPDATE - Added support for preloading comments with the Comments and Preloaded add-ons.
334
+ * Shortcode Builder UI improvements
335
 
336
 
337
  = 2.11.0 - May 25, 2016 =
admin/admin.php CHANGED
@@ -1220,10 +1220,8 @@ function alm_btn_color_callback() {
1220
  $html .= '<option value="default" class="alm-color default" ' . $selected0 .'>Default</option>';
1221
  $html .= '<option value="blue" class="alm-color blue" ' . $selected1 .'>Blue</option>';
1222
  $html .= '<option value="green" class="alm-color green" ' . $selected2 .'>Green</option>';
1223
- //$html .= '<option value="red" ' . $selected3 .'>Red</option>';
1224
  $html .= '<option value="purple" class="alm-color purple" ' . $selected4 .'>Purple</option>';
1225
  $html .= '<option value="grey" class="alm-color grey" ' . $selected5 .'>Grey</option>';
1226
- //$html .= '<option value="white" ' . $selected6 .'>White (Button)</option>';
1227
  $html .= '</optgroup>';
1228
  $html .= '<optgroup label="Infinite Scroll (no button)">';
1229
  $html .= '<option value="infinite classic" class="infinite classic" ' . $selected7 .'>Classic</option>';
1220
  $html .= '<option value="default" class="alm-color default" ' . $selected0 .'>Default</option>';
1221
  $html .= '<option value="blue" class="alm-color blue" ' . $selected1 .'>Blue</option>';
1222
  $html .= '<option value="green" class="alm-color green" ' . $selected2 .'>Green</option>';
 
1223
  $html .= '<option value="purple" class="alm-color purple" ' . $selected4 .'>Purple</option>';
1224
  $html .= '<option value="grey" class="alm-color grey" ' . $selected5 .'>Grey</option>';
 
1225
  $html .= '</optgroup>';
1226
  $html .= '<optgroup label="Infinite Scroll (no button)">';
1227
  $html .= '<option value="infinite classic" class="infinite classic" ' . $selected7 .'>Classic</option>';
admin/css/admin.css CHANGED
@@ -138,7 +138,7 @@
138
  color: #999;
139
  padding: 0 0 0 12px;
140
  border-left: 5px solid #ff5a58;
141
- margin: 0 0 16px;
142
  font-size: 13px;
143
  }
144
  .ajax-load-more code{
@@ -877,6 +877,7 @@ a.layout-hover{
877
  .preload_amount,
878
  .cache_id,
879
  .alternate_template_wrap,
 
880
  .restapi_options{
881
  display: none;
882
  }
@@ -1478,7 +1479,9 @@ table.highlight{
1478
  font-size: 14px;
1479
  padding: 8px 14px;
1480
  }
1481
- .ajax-load-more .cnkt-main .group.installed{ }
 
 
1482
 
1483
  #alm-add-ons .group img{
1484
  padding: 12px 18px 12px;
@@ -1488,17 +1491,8 @@ table.highlight{
1488
  display: block;
1489
  padding: 15px;
1490
  }
1491
- #alm-add-ons .group:hover{
1492
- border-color: #999;
1493
- -webkit-box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
1494
- -moz-box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
1495
- box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
1496
- }
1497
  #alm-add-ons .group.installed:hover{
1498
  border-color: #ccc;
1499
- -webkit-box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
1500
- -moz-box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
1501
- box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
1502
  }
1503
  #alm-add-ons .group a:hover h2{
1504
  color: #ff5a58 !important;
@@ -1727,13 +1721,14 @@ table.highlight{
1727
  }
1728
  .license-wrap label{
1729
  font-weight: 600;
1730
- position: relative;
1731
  top:-3px;
1732
  }
1733
  .license-wrap input[type=text]{
1734
  background-color: #fff;
1735
  margin: 0 0 15px;
1736
  width: 100% !important;
 
1737
  }
1738
  .license-wrap input[type=text]:focus{
1739
  background-color: #fff;
138
  color: #999;
139
  padding: 0 0 0 12px;
140
  border-left: 5px solid #ff5a58;
141
+ margin: 0 0 30px;
142
  font-size: 13px;
143
  }
144
  .ajax-load-more code{
877
  .preload_amount,
878
  .cache_id,
879
  .alternate_template_wrap,
880
+ .cta_template_wrap,
881
  .restapi_options{
882
  display: none;
883
  }
1479
  font-size: 14px;
1480
  padding: 8px 14px;
1481
  }
1482
+ .ajax-load-more .cnkt-main .group.installed{
1483
+ opacity: 0.7;
1484
+ }
1485
 
1486
  #alm-add-ons .group img{
1487
  padding: 12px 18px 12px;
1491
  display: block;
1492
  padding: 15px;
1493
  }
 
 
 
 
 
 
1494
  #alm-add-ons .group.installed:hover{
1495
  border-color: #ccc;
 
 
 
1496
  }
1497
  #alm-add-ons .group a:hover h2{
1498
  color: #ff5a58 !important;
1721
  }
1722
  .license-wrap label{
1723
  font-weight: 600;
1724
+ /* position: relative; */
1725
  top:-3px;
1726
  }
1727
  .license-wrap input[type=text]{
1728
  background-color: #fff;
1729
  margin: 0 0 15px;
1730
  width: 100% !important;
1731
+ border-color: #ccc;
1732
  }
1733
  .license-wrap input[type=text]:focus{
1734
  background-color: #fff;
admin/img/add-ons/cta-add-on.jpg ADDED
Binary file
admin/includes/cta/about.php CHANGED
@@ -4,8 +4,7 @@
4
  <li><strong><a target="blank" href="https://connekthq.com/plugins/easy-query/">Easy Query</a></strong><br>A simple solution to build and display WordPress queries without touching a single line of code.</li>
5
  <li><strong><a target="blank" href="https://connekthq.com/plugins/velocity/">Velocity</a></strong><br>Improve website performance by lazy loading and customizing your embedded media with Velocity.</li>
6
  <li><strong><a target="blank" href="https://connekthq.com/plugins/unsplash-wp/">Unsplash WP</a></strong><br>The fastest way to upload high quality stock photos from unsplash.com directly to your media library.</li>
7
- <li><strong><a target="blank" href="https://github.com/dcooney/flexpanel">FlexPanel</a></strong><br>A responsive scrolling panel navigation for mobile and desktop.</li>
8
- <li><strong><a target="blank" href="https://connekthq.com">Connekt Media</a></strong><br>A digital creation company.</li>
9
  </ul>
10
  </div>
11
 
4
  <li><strong><a target="blank" href="https://connekthq.com/plugins/easy-query/">Easy Query</a></strong><br>A simple solution to build and display WordPress queries without touching a single line of code.</li>
5
  <li><strong><a target="blank" href="https://connekthq.com/plugins/velocity/">Velocity</a></strong><br>Improve website performance by lazy loading and customizing your embedded media with Velocity.</li>
6
  <li><strong><a target="blank" href="https://connekthq.com/plugins/unsplash-wp/">Unsplash WP</a></strong><br>The fastest way to upload high quality stock photos from unsplash.com directly to your media library.</li>
7
+ <li><strong><a target="blank" href="https://connekthq.com">Connekt Media</a></strong><br>Handcrafted digital products.</li>
 
8
  </ul>
9
  </div>
10
 
admin/includes/cta/add-ons.php CHANGED
@@ -3,6 +3,7 @@
3
  <p>Ajax Load More offers a variety of unique add-ons that will extend and enhance the core functionality of the plugin.</p>
4
  <ul>
5
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Cache">Cache</a></li>
 
6
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Comments">Comments</a></li>
7
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/custom-repeaters/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Custom%20Repeaters">Custom Repeaters</a></li>
8
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/layouts/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Layouts">Layouts</a></li>
3
  <p>Ajax Load More offers a variety of unique add-ons that will extend and enhance the core functionality of the plugin.</p>
4
  <ul>
5
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Cache">Cache</a></li>
6
+ <!-- <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/call-to-actions/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Call to Actions">Call to Actions</a></li> -->
7
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Comments">Comments</a></li>
8
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/custom-repeaters/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Custom%20Repeaters">Custom Repeaters</a></li>
9
  <li><a target="blank" href="https://connekthq.com/plugins/ajax-load-more/add-ons/layouts/?utm_source=WP%20Admin&utm_medium=ALM%20Settings&utm_campaign=Layouts">Layouts</a></li>
admin/shortcode-builder/js/shortcode-builder.js CHANGED
@@ -171,6 +171,43 @@ jQuery(document).ready(function($) {
171
  output += ' cache_id="'+cache_id+'"';
172
  }else{
173
  $('.cache_id').slideUp(100, 'alm_easeInOutQuad')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
 
176
 
@@ -221,7 +258,7 @@ jQuery(document).ready(function($) {
221
 
222
 
223
  // ---------------------------
224
- // - PAGING
225
  // ---------------------------
226
 
227
  var paging = $('#alm-paging input[name=paging]:checked').val();
@@ -320,8 +357,7 @@ jQuery(document).ready(function($) {
320
 
321
  }else{
322
  $('.restapi_options').slideUp(100, 'alm_easeInOutQuad')
323
- }
324
-
325
 
326
 
327
  // ---------------------------
@@ -334,63 +370,24 @@ jQuery(document).ready(function($) {
334
 
335
  output += ' seo="'+seo+'"';
336
  }
337
-
338
-
339
 
340
  // ---------------------------
341
  // - Repeater
342
  // ---------------------------
343
 
344
- var repeater = $('.repeater select[name=repeater-select]').val(),
345
- theme_repeater = $('.select-theme-repeater select[name=theme-repeater-select]').val();
346
-
347
  if(theme_repeater != 'null' && theme_repeater != '' && theme_repeater != undefined){
348
  output += ' theme_repeater="'+theme_repeater+'"';
349
  }else{
350
  if(repeater != '' && repeater != undefined && repeater != 'default'){
351
  output += ' repeater="'+repeater+'"';
352
  }
353
- }
354
-
355
-
356
-
357
- // ---------------------------
358
- // - Alternate Repeater
359
- // ---------------------------
360
-
361
- var alternate_container = $('#alm-alternate');
362
- var alternate = $('input[name=alternate]:checked', alternate_container).val();
363
- var alternate_sequence = $('input[name=alternate-sequence]', alternate_container).val();
364
- var alternate_sequence_max = $('input[name=alternate-sequence-max]', alternate_container).val();
365
- var alternate_repeater = $('select[name=alternate-repeater-select]', alternate_container).val();
366
- var alternate_theme_repeater = $('select[name=theme-repeater-select]', alternate_container).val();
367
- if(alternate !== 'false' && alternate != undefined){
368
-
369
- $('.alternate_template_wrap').slideDown(100, 'alm_easeInOutQuad');
370
-
371
- // Standard repeater
372
- if(alternate_repeater != '' && alternate_repeater != undefined && alternate_sequence != '' && alternate_sequence != null){
373
- output += ' alternate="'+alternate+'"';
374
- output += ' alternate_repeater="'+alternate_repeater+'"';
375
- output += ' alternate_sequence="'+alternate_sequence+'"';
376
- output += ' alternate_sequence_max="'+alternate_sequence_max+'"';
377
- }
378
- // Theme repeater
379
- if(alternate_theme_repeater != '' && alternate_theme_repeater != undefined && alternate_sequence != '' && alternate_sequence != null){
380
- output += ' alternate="'+alternate+'"';
381
- output += ' alternate_theme_repeater="'+alternate_theme_repeater+'"';
382
- output += ' alternate_sequence="'+alternate_sequence+'"';
383
- output += ' alternate_sequence_max="'+alternate_sequence_max+'"';
384
- }
385
-
386
- }else{
387
-
388
- $('.alternate_template_wrap').slideUp(100, 'alm_easeInOutQuad');
389
-
390
- }
391
-
392
 
393
-
394
  // ---------------------------
395
  // - Post Types
396
  // ---------------------------
@@ -413,8 +410,7 @@ jQuery(document).ready(function($) {
413
  if(post_type_count>0){
414
  output += '"';
415
  }
416
- }
417
-
418
 
419
 
420
  // ---------------------------
@@ -856,8 +852,7 @@ jQuery(document).ready(function($) {
856
  output += ' button_label="'+button_label+'"';
857
 
858
  if(button_loading_label !== '')
859
- output += ' button_loading_label="'+button_loading_label+'"';
860
-
861
 
862
 
863
 
171
  output += ' cache_id="'+cache_id+'"';
172
  }else{
173
  $('.cache_id').slideUp(100, 'alm_easeInOutQuad')
174
+ }
175
+
176
+
177
+ // ---------------------------
178
+ // - Call to Actions
179
+ // ---------------------------
180
+
181
+ var cta_container = $('#alm-cta');
182
+ var cta = $('input[name=cta]:checked', cta_container).val();
183
+ var cta_position = $('input[name=cta-position]', cta_container).val();
184
+ var cta_before_after = $('select[name=cta-before-after]', cta_container).val();
185
+ var cta_repeat = $('input[name=cta-repeat]', cta_container).val();
186
+ var cta_repeater = $('select[name=cta-repeater-select]', cta_container).val();
187
+ var cta_theme_repeater = $('select[name=theme-repeater-select]', cta_container).val();
188
+
189
+ if(cta !== 'false' && cta != undefined){
190
+ $('.cta_template_wrap').slideDown(100, 'alm_easeInOutQuad');
191
+ // Standard repeater
192
+ if(cta_repeater != '' && cta_repeater != undefined && cta_position != '' && cta_position != null){
193
+ output += ' cta="'+cta+'"';
194
+ output += ' cta_position="'+cta_before_after+':'+cta_position+':'+cta_repeat+'"';
195
+ output += ' cta_repeater="'+cta_repeater+'"';
196
+ }
197
+ // Theme repeater
198
+ if(cta_theme_repeater != '' && cta_theme_repeater != undefined && cta_position != '' && cta_position != null){
199
+ output += ' cta="'+cta+'"';
200
+ output += ' cta_position="'+cta_before_after+':'+cta_position+':'+cta_repeat+'"';
201
+ output += ' cta_theme_repeater="'+cta_theme_repeater+'"';
202
+ }
203
+ $('#sequence-update').text(cta_position);
204
+ $('#sequence-update-before-after').text(cta_before_after);
205
+ if(cta_repeat == 0){
206
+ cta_repeat = 'unlimited';
207
+ }
208
+ $('#sequence-repeat, #cta-repeat-label').text(cta_repeat);
209
+ }else{
210
+ $('.cta_template_wrap').slideUp(100, 'alm_easeInOutQuad');
211
  }
212
 
213
 
258
 
259
 
260
  // ---------------------------
261
+ // - Paging
262
  // ---------------------------
263
 
264
  var paging = $('#alm-paging input[name=paging]:checked').val();
357
 
358
  }else{
359
  $('.restapi_options').slideUp(100, 'alm_easeInOutQuad')
360
+ }
 
361
 
362
 
363
  // ---------------------------
370
 
371
  output += ' seo="'+seo+'"';
372
  }
373
+
 
374
 
375
  // ---------------------------
376
  // - Repeater
377
  // ---------------------------
378
 
379
+ var repeater = $('#alm-repeaters select[name=repeater-select]').val(),
380
+ theme_repeater = $('#alm-repeaters .select-theme-repeater select[name=theme-repeater-select]').val();
381
+
382
  if(theme_repeater != 'null' && theme_repeater != '' && theme_repeater != undefined){
383
  output += ' theme_repeater="'+theme_repeater+'"';
384
  }else{
385
  if(repeater != '' && repeater != undefined && repeater != 'default'){
386
  output += ' repeater="'+repeater+'"';
387
  }
388
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
+
391
  // ---------------------------
392
  // - Post Types
393
  // ---------------------------
410
  if(post_type_count>0){
411
  output += '"';
412
  }
413
+ }
 
414
 
415
 
416
  // ---------------------------
852
  output += ' button_label="'+button_label+'"';
853
 
854
  if(button_loading_label !== '')
855
+ output += ' button_loading_label="'+button_loading_label+'"';
 
856
 
857
 
858
 
admin/shortcode-builder/shortcode-builder.php CHANGED
@@ -15,7 +15,6 @@
15
  <h3 class="heading"><?php _e('Cache', 'ajax-load-more'); ?></h3>
16
  <div class="expand-wrap">
17
  <div class="section-title">
18
- <h4><?php _e('Enable Caching', 'ajax-load-more'); ?></h4>
19
  <p><?php _e('Turn on content caching.', 'ajax-load-more'); ?></p>
20
  </div>
21
  <div class="wrap">
@@ -53,13 +52,112 @@
53
  <?php } ?>
54
 
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  <?php if(has_action('alm_comments_installed')){ ?>
57
  <!-- COMMENTS -->
58
  <div class="row input comments add-on" id="alm-comments">
59
  <h3 class="heading"><?php _e('Comments', 'ajax-load-more'); ?></h3>
60
  <div class="expand-wrap">
61
  <div class="section-title">
62
- <h4><?php _e('Comments', 'ajax-load-more'); ?></h4>
63
  <p><?php _e('Enable Ajax Load More to display blog comments.', 'ajax-load-more'); ?></p>
64
  </div>
65
  <div class="wrap">
@@ -214,8 +312,7 @@
214
  <div class="row input paging add-on" id="alm-paging">
215
  <h3 class="heading"><?php _e('Paging', 'ajax-load-more'); ?></h3>
216
  <div class="expand-wrap">
217
- <div class="section-title">
218
- <p><?php _e('Replace infinite scrolling with a paged ajax navigation system.', 'ajax-load-more'); ?></p>
219
  </div>
220
  <div class="wrap">
221
  <div class="inner">
@@ -604,105 +701,7 @@
604
  echo '</div>';
605
  echo '</div>';
606
 
607
- ?>
608
-
609
- <?php if(has_action('alm_alternating_installed')){ ?>
610
- <div class="row alternating add-on" id="alm-alternate">
611
- <h3 class="heading"><?php _e('Alternating Templates', 'ajax-load-more'); ?></h3>
612
- <div class="expand-wrap">
613
-
614
- <div class="section-title">
615
- <p><?php _e('Select an alternate repeater template to be display every <em>x</em> number of posts.', 'ajax-load-more'); ?></p>
616
- </div>
617
- <div class="wrap">
618
- <div class="inner">
619
- <ul>
620
- <li>
621
- <input class="alm_element" type="radio" name="alternate" value="true" id="alternate-true" >
622
- <label for="alternate-true"><?php _e('True', 'ajax-load-more'); ?></label>
623
- </li>
624
- <li>
625
- <input class="alm_element" type="radio" name="alternate" value="false" id="alternate-false" checked="checked">
626
- <label for="alternate-false"><?php _e('False', 'ajax-load-more'); ?></label>
627
- </li>
628
- </ul>
629
- </div>
630
- </div>
631
- <div class="clear"></div>
632
-
633
- <div class="alternate_template_wrap">
634
-
635
- <hr/>
636
- <div class="spacer"></div>
637
-
638
- <div class="section-title">
639
- <h4><?php _e('Template Sequencing', 'ajax-load-more'); ?></h4>
640
- <p><?php _e('A comma separated list of post position values. Posts in these positions will be replaced by the alternate template', 'ajax-load-more'); ?>.<br/><br/>
641
- <strong><?php _e('Pro-Tip', 'ajax-load-more'); ?></strong> -
642
- <?php _e('Use sequence "even" to use an alternate template for every even result', 'ajax-load-more'); ?>.</p>
643
- </div>
644
- <div class="wrap">
645
- <div class="inner">
646
- <input type="text" placeholder="3, 4, 7, 8" id="alternate-sequence-max" class="alm_element sm" name="alternate-sequence">
647
- </div>
648
- </div>
649
-
650
- <div class="clear"></div>
651
- <hr/>
652
- <div class="spacer"></div>
653
-
654
- <div class="section-title">
655
- <h4><?php _e('Sequence Loop', 'ajax-load-more'); ?></h4>
656
- <p>
657
- <?php _e('Select the maximum number of loops to repeat alternate template sequence.', 'ajax-load-more'); ?><br/><br/>
658
- <?php _e('0 = no maximum', 'ajax-load-more'); ?>
659
- </p>
660
- </div>
661
- <div class="wrap">
662
- <div class="inner">
663
- <input type="number" placeholder="0" id="alternate-sequence-max" class="alm_element sm numbers-only" name="alternate-sequence-max" value="0" step="1" min="0">
664
-
665
- </div>
666
- </div>
667
-
668
- <div class="clear"></div>
669
- <hr/>
670
- <div class="spacer"></div>
671
-
672
- <div class="section-title">
673
- <h4><?php _e('Repeater Template', 'ajax-load-more'); ?></h4>
674
- <?php
675
- echo '<p>'.__('Select an alternate <a href="admin.php?page=ajax-load-more-repeaters" target="_parent">repeater template</a>.', 'ajax-load-more'). '</p>';
676
- ?>
677
- </div>
678
- <div class="wrap">
679
- <div class="inner">
680
- <?php
681
- echo '<select name="alternate-repeater-select" class="alm_element">';
682
- echo '<option name="" value="" selected="selected">'.__('-- Select Repeater --', 'ajax-load-more').'</option>';
683
- echo '<option name="default" value="default">Default</option>';
684
- if (has_action('alm_get_custom_repeaters')) {
685
- do_action('alm_get_custom_repeaters');
686
- }
687
- if (has_action('alm_get_unlimited_repeaters')) {
688
- do_action('alm_get_unlimited_repeaters');
689
- }
690
- echo '</select>';
691
- ?>
692
- </div>
693
- </div>
694
- <?php
695
- // Get Theme Repeaters
696
- if (has_action('alm_theme_repeaters_selection')){
697
- do_action('alm_theme_repeaters_selection');
698
- }
699
- ?>
700
-
701
- </div>
702
-
703
- </div>
704
- </div>
705
- <?php } ?>
706
 
707
 
708
  <?php
@@ -1332,7 +1331,7 @@
1332
 
1333
  <!-- Button Text -->
1334
  <div class="row input btn-label" id="alm-btn-label">
1335
- <h3 class="heading"><?php _e('Button Labels', 'ajax-load-more'); ?></h3>
1336
 
1337
  <div class="expand-wrap">
1338
 
@@ -1357,7 +1356,7 @@
1357
  <div class="inner">
1358
  <input class="alm_element" name="button-loading-label" type="text" id="button-loading-label" value="" placeholder="<?php _e('Loading Posts...', 'ajax-load-more'); ?>">
1359
  </div>
1360
- </div>
1361
 
1362
  </div>
1363
  </div>
@@ -1389,8 +1388,10 @@
1389
  </ul>
1390
  </div>
1391
  </div>
 
1392
  <div class="clear"></div>
1393
  <hr/>
 
1394
  <div class="section-title">
1395
  <h4><?php _e('Container Classes', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('You can define global container classes on the Ajax Load More settings screen','ajax-load-more'); ?>"></a></h4>
1396
  <p><?php _e('Add custom CSS classes to the Ajax Load More container. <br/><br/> e.g. portfolio-listing large-12 etc', 'ajax-load-more'); ?></p>
15
  <h3 class="heading"><?php _e('Cache', 'ajax-load-more'); ?></h3>
16
  <div class="expand-wrap">
17
  <div class="section-title">
 
18
  <p><?php _e('Turn on content caching.', 'ajax-load-more'); ?></p>
19
  </div>
20
  <div class="wrap">
52
  <?php } ?>
53
 
54
 
55
+ <?php if(has_action('alm_cta_installed')){ ?>
56
+ <!-- Call to Actions -->
57
+ <div class="row cta add-on" id="alm-cta">
58
+ <h3 class="heading"><?php _e('Call to Actions', 'ajax-load-more'); ?></h3>
59
+ <div class="expand-wrap">
60
+
61
+ <div class="section-title">
62
+ <p><?php _e('Insert call to action block.', 'ajax-load-more'); ?></p>
63
+ </div>
64
+ <div class="wrap">
65
+ <div class="inner">
66
+ <ul>
67
+ <li>
68
+ <input class="alm_element" type="radio" name="cta" value="true" id="cta-true" >
69
+ <label for="cta-true"><?php _e('True', 'ajax-load-more'); ?></label>
70
+ </li>
71
+ <li>
72
+ <input class="alm_element" type="radio" name="cta" value="false" id="cta-false" checked="checked">
73
+ <label for="cta-false"><?php _e('False', 'ajax-load-more'); ?></label>
74
+ </li>
75
+ </ul>
76
+ </div>
77
+ </div>
78
+ <div class="clear"></div>
79
+
80
+ <div class="cta_template_wrap">
81
+
82
+ <hr/>
83
+ <div class="spacer"></div>
84
+
85
+ <div class="section-title">
86
+ <h4><?php _e('CTA Positioning', 'ajax-load-more'); ?></h4>
87
+ <p><?php _e('Insert call to action <strong><em id="sequence-update-before-after">before</em></strong> post #<strong><em id="sequence-update">1</em></strong> for <strong><em id="sequence-repeat">unlimited</em></strong> page(s)', 'ajax-load-more'); ?>.</p>
88
+ </div>
89
+ <div class="wrap">
90
+ <div class="inner">
91
+
92
+ <label class="full"><?php _e('Before / After', 'ajax-load-more'); ?>:</label>
93
+ <select class="alm_element cta-before-after" name="cta-before-after" id="cta-before-after">
94
+ <option value="before" selected="selected"><?php _e('Before', 'ajax-load-more'); ?></option>
95
+ <option value="after"><?php _e('After', 'ajax-load-more'); ?></option>
96
+ </select>
97
+ <div class="clear"></div>
98
+ <div class="spacer" style="height: 30px;"></div>
99
+ <label class="full" for="cta-position"><?php _e('Post #', 'ajax-load-more'); ?>:</label>
100
+ <input type="number" min="1" step="1" value="1" placeholder="1" id="cta-position" class="alm_element numbers-only" name="cta-position">
101
+ <div class="clear"></div>
102
+ <div class="spacer" style="height: 30px;"></div>
103
+ <label class="full" for="cta-repeat"><?php _e('Repeat for', 'ajax-load-more'); ?> <strong id="cta-repeat-label">unlimited</strong> <?php _e('page(s)', 'ajax-load-more'); ?>:</label>
104
+ <input type="number" min="0" step="1" value="0" placeholder="0" value="0" id="cta-repeat" class="alm_element numbers-only" name="cta-repeat">
105
+
106
+ </div>
107
+ </div>
108
+
109
+ <div class="clear"></div>
110
+ <hr/>
111
+ <div class="spacer"></div>
112
+
113
+ <div class="section-title">
114
+ <h4><?php _e('Template', 'ajax-load-more'); ?></h4>
115
+ <?php
116
+ echo '<p>'.__('Select the <a href="admin.php?page=ajax-load-more-repeaters" target="_parent">repeater template</a> that will display your call to action.', 'ajax-load-more'). '</p>';
117
+ ?>
118
+ </div>
119
+ <div class="wrap">
120
+ <div class="inner">
121
+ <?php
122
+ echo '<select name="cta-repeater-select" class="alm_element">';
123
+ echo '<option name="" value="" selected="selected">'.__('-- Select Repeater --', 'ajax-load-more').'</option>';
124
+ echo '<option name="default" value="default">Default</option>';
125
+ if (has_action('alm_get_custom_repeaters')) {
126
+ do_action('alm_get_custom_repeaters');
127
+ }
128
+ if (has_action('alm_get_unlimited_repeaters')) {
129
+ do_action('alm_get_unlimited_repeaters');
130
+ }
131
+ echo '</select>';
132
+ ?>
133
+ </div>
134
+ </div>
135
+ <?php
136
+ // Get Theme Repeaters
137
+ if (has_action('alm_theme_repeaters_selection')){
138
+ do_action('alm_theme_repeaters_selection');
139
+ }
140
+ ?>
141
+
142
+
143
+ <p class="warning-callout">
144
+ <?php _e('Call to actions do NOT count as a post within an Ajax Load More loop.<br/>
145
+ For example, if you set <strong>posts_per_page="5"</strong> in your shortcode, 6 items will be displayed.', 'ajax-load-more'); ?>
146
+ </p>
147
+
148
+ </div>
149
+
150
+ </div>
151
+ </div>
152
+ <?php } ?>
153
+
154
+
155
  <?php if(has_action('alm_comments_installed')){ ?>
156
  <!-- COMMENTS -->
157
  <div class="row input comments add-on" id="alm-comments">
158
  <h3 class="heading"><?php _e('Comments', 'ajax-load-more'); ?></h3>
159
  <div class="expand-wrap">
160
  <div class="section-title">
 
161
  <p><?php _e('Enable Ajax Load More to display blog comments.', 'ajax-load-more'); ?></p>
162
  </div>
163
  <div class="wrap">
312
  <div class="row input paging add-on" id="alm-paging">
313
  <h3 class="heading"><?php _e('Paging', 'ajax-load-more'); ?></h3>
314
  <div class="expand-wrap">
315
+ <div class="section-title"> <p><?php _e('Replace infinite scrolling with a paged ajax navigation system.', 'ajax-load-more'); ?></p>
 
316
  </div>
317
  <div class="wrap">
318
  <div class="inner">
701
  echo '</div>';
702
  echo '</div>';
703
 
704
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
 
706
 
707
  <?php
1331
 
1332
  <!-- Button Text -->
1333
  <div class="row input btn-label" id="alm-btn-label">
1334
+ <h3 class="heading"><?php _e('Button Options', 'ajax-load-more'); ?></h3>
1335
 
1336
  <div class="expand-wrap">
1337
 
1356
  <div class="inner">
1357
  <input class="alm_element" name="button-loading-label" type="text" id="button-loading-label" value="" placeholder="<?php _e('Loading Posts...', 'ajax-load-more'); ?>">
1358
  </div>
1359
+ </div>
1360
 
1361
  </div>
1362
  </div>
1388
  </ul>
1389
  </div>
1390
  </div>
1391
+
1392
  <div class="clear"></div>
1393
  <hr/>
1394
+
1395
  <div class="section-title">
1396
  <h4><?php _e('Container Classes', 'ajax-load-more'); ?> <a href="javascript:void(0)" class="fa fa-question-circle tooltip" title="<?php _e('You can define global container classes on the Ajax Load More settings screen','ajax-load-more'); ?>"></a></h4>
1397
  <p><?php _e('Add custom CSS classes to the Ajax Load More container. <br/><br/> e.g. portfolio-listing large-12 etc', 'ajax-load-more'); ?></p>
admin/views/add-ons.php CHANGED
@@ -5,6 +5,34 @@
5
  <p><?php _e('Add-ons are available to extend and enhance the core functionality of Ajax Load More', 'ajax-load-more'); ?>.</p>
6
  </div>
7
  <div class="cnkt-main full">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  <!-- Cache -->
10
  <div class="group<?php if (has_action('alm_cache_installed')){echo ' installed'; } ?>">
@@ -30,8 +58,7 @@
30
  </div>
31
 
32
  </div>
33
- <!-- End Cache -->
34
-
35
 
36
  <!-- Comments -->
37
  <div class="group<?php if (has_action('alm_comments_installed')){echo ' installed'; } ?>">
@@ -57,7 +84,7 @@
57
  </div>
58
 
59
  </div>
60
- <!-- End Cache -->
61
 
62
 
63
  <!-- Custom Repeaters -->
5
  <p><?php _e('Add-ons are available to extend and enhance the core functionality of Ajax Load More', 'ajax-load-more'); ?>.</p>
6
  </div>
7
  <div class="cnkt-main full">
8
+
9
+
10
+ <!-- Call to Actions -->
11
+ <div style="display:none !important;" class="group<?php if (has_action('alm_cta_installed')){echo ' installed'; } ?>">
12
+ <div class="row no-brd">
13
+ <?php
14
+ $cta_url = 'https://connekthq.com/plugins/ajax-load-more/add-ons/call-to-actions/?utm_source=WP%20Admin&utm_medium=ALM%20Add-ons&utm_campaign=Call to Actions'; ?>
15
+
16
+ <a href="<?php echo $cta_url; ?>">
17
+ <div class="expand-wrap">
18
+ <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/cta-add-on.jpg" alt="">
19
+ <h2 class="addon-title"><?php _e('Call to Actions', 'ajax-load-more'); ?></h2>
20
+ <p class="addon-intro"><?php _e('Ajax Load More extension for displaying advertisements and call to actions.', 'ajax-load-more'); ?></p>
21
+ <p><?php _e('The Call to Actions add-on will provide the ability to inject a custom CTA template within each Ajax Load More loop.', 'ajax-load-more'); ?></p>
22
+ <?php
23
+ if (has_action('alm_cta_installed')){
24
+ echo '<span class="cnkt-button installed"><i class="fa fa-check-square"></i> Installed</span> ';
25
+ }else{
26
+ echo '<span class="cnkt-button"><i class="fa fa-download"></i> Purchase &amp; Install</span>';
27
+ }
28
+ ?>
29
+ </div>
30
+ </a>
31
+ </div>
32
+
33
+ </div>
34
+ <!-- End Call to Actions -->
35
+
36
 
37
  <!-- Cache -->
38
  <div class="group<?php if (has_action('alm_cache_installed')){echo ' installed'; } ?>">
58
  </div>
59
 
60
  </div>
61
+ <!-- End Cache -->
 
62
 
63
  <!-- Comments -->
64
  <div class="group<?php if (has_action('alm_comments_installed')){echo ' installed'; } ?>">
84
  </div>
85
 
86
  </div>
87
+ <!-- End Comments -->
88
 
89
 
90
  <!-- Custom Repeaters -->
admin/views/licenses.php CHANGED
@@ -11,8 +11,8 @@
11
  <p><?php _e('Manage your Ajax Load More license key\'s below - enter a key for each of your add-ons to receive plugin update notifications directly within the <a href="plugins.php">WP Plugins dashboard</a>.', 'ajax-load-more'); ?></p>
12
 
13
  <?php
14
- // alm_alternating_installed
15
  // alm_cache_installed
 
16
  // alm_comments_installed
17
  // alm_unlimited_installed
18
  // alm_layouts_installed
@@ -26,28 +26,28 @@
26
 
27
  <?php
28
  // Check if any add ons are installed.
29
- if(has_action('alm_alternating_installed') || has_action('alm_cache_installed') || has_action('alm_comments_installed') || has_action('alm_unlimited_installed') || has_action('alm_layouts_installed') || has_action('alm_preload_installed') || has_action('alm_paging_installed') || has_action('alm_prev_post_installed') || has_action('alm_rest_api_installed') || has_action('alm_seo_installed') || has_action('alm_theme_repeaters_installed')) : ?>
30
-
31
 
32
  <?php
33
- if (has_action('alm_alternating_installed')){
34
  // CACHE
35
- $alm_alternating_license = get_option( 'alm_alternating_license_key' );
36
- $alm_alternating_status = get_option( 'alm_alternating_license_status' );
37
  ?>
38
- <div class="license" id="license-alternating">
39
  <div class="license-title">
40
- <div class="status <?php if($alm_alternating_status == 'valid'){echo 'valid';}else{echo 'invalid';} ?> "></div>
41
- <h2><?php _e('Alternating Templates', 'ajax-load-more'); ?></h2>
42
  </div>
43
  <div class="license-wrap">
44
  <form method="post" action="options.php">
45
 
46
- <?php settings_fields('alm_alternating_license'); ?>
47
- <label class="description" for="alm_alternating_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
48
  <div class="license-key-field">
49
- <input id="alm_alternating_license_key" name="alm_alternating_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_alternating_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
50
- <?php if( $alm_alternating_status !== false && $alm_alternating_status == 'valid' ) { ?>
51
  <span class="status active">
52
  <?php _e('Active', 'ajax-load-more'); ?>
53
  </span>
@@ -58,18 +58,18 @@
58
  <?php } ?>
59
  </div>
60
 
61
- <?php wp_nonce_field( 'alm_alternating_license_nonce', 'alm_alternating_license_nonce' ); ?>
62
  <div class="license-btn-wrap"
63
- data-name="<?php echo ALM_ALTERNATING_ITEM_NAME; ?>"
64
  data-url="<?php echo ALM_STORE_URL; ?>"
65
- data-option-status="alm_alternating_license_status"
66
- data-option-key="alm_alternating_license_key"
67
- data-upgrade-url="https://connekthq.com/plugins/ajax-load-more/add-ons/alternating-templates/">
68
- <button type="button" class="activate license-btn <?php if($alm_alternating_status === 'valid'){ echo 'hide'; } ?> button-primary" data-type="activate">
69
  <?php _e('Activate License', 'ajax-load-more'); ?>
70
  </button>
71
 
72
- <button type="button" class="deactivate license-btn <?php if($alm_alternating_status !== 'valid'){ echo 'hide'; } ?> button-secondary" data-type="deactivate">
73
  <?php _e('Deactivate License', 'ajax-load-more'); ?>
74
  </button>
75
  </div>
@@ -80,29 +80,28 @@
80
  </div>
81
  <?php
82
  }
83
- // End alternating
84
  ?>
85
 
86
-
87
  <?php
88
- if (has_action('alm_cache_installed')){
89
- // CACHE
90
- $alm_cache_license = get_option( 'alm_cache_license_key' );
91
- $alm_cache_status = get_option( 'alm_cache_license_status' );
92
  ?>
93
- <div class="license" id="license-cache">
94
  <div class="license-title">
95
- <div class="status <?php if($alm_cache_status == 'valid'){echo 'valid';}else{echo 'invalid';} ?> "></div>
96
- <h2><?php _e('Cache', 'ajax-load-more'); ?></h2>
97
  </div>
98
  <div class="license-wrap">
99
  <form method="post" action="options.php">
100
 
101
- <?php settings_fields('alm_cache_license'); ?>
102
- <label class="description" for="alm_cache_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
103
  <div class="license-key-field">
104
- <input id="alm_cache_license_key" name="alm_cache_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_cache_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
105
- <?php if( $alm_cache_status !== false && $alm_cache_status == 'valid' ) { ?>
106
  <span class="status active">
107
  <?php _e('Active', 'ajax-load-more'); ?>
108
  </span>
@@ -113,18 +112,18 @@
113
  <?php } ?>
114
  </div>
115
 
116
- <?php wp_nonce_field( 'alm_cache_license_nonce', 'alm_cache_license_nonce' ); ?>
117
  <div class="license-btn-wrap"
118
- data-name="<?php echo ALM_CACHE_ITEM_NAME; ?>"
119
  data-url="<?php echo ALM_STORE_URL; ?>"
120
- data-option-status="alm_cache_license_status"
121
- data-option-key="alm_cache_license_key"
122
- data-upgrade-url="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/">
123
- <button type="button" class="activate license-btn <?php if($alm_cache_status === 'valid'){ echo 'hide'; } ?> button-primary" data-type="activate">
124
  <?php _e('Activate License', 'ajax-load-more'); ?>
125
  </button>
126
 
127
- <button type="button" class="deactivate license-btn <?php if($alm_cache_status !== 'valid'){ echo 'hide'; } ?> button-secondary" data-type="deactivate">
128
  <?php _e('Deactivate License', 'ajax-load-more'); ?>
129
  </button>
130
  </div>
@@ -135,7 +134,7 @@
135
  </div>
136
  <?php
137
  }
138
- // End CACHE
139
  ?>
140
 
141
  <?php
@@ -153,7 +152,7 @@
153
  <form method="post" action="options.php">
154
 
155
  <?php settings_fields('alm_comments_license'); ?>
156
- <label class="description" for="alm_comments_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
157
  <div class="license-key-field">
158
  <input id="alm_comments_license_key" name="alm_comments_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_comments_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
159
  <?php if( $alm_comments_status !== false && $alm_comments_status == 'valid' ) { ?>
@@ -208,7 +207,7 @@
208
  <form method="post" action="options.php">
209
 
210
  <?php settings_fields('alm_unlimited_license'); ?>
211
- <label class="description" for="alm_unlimited_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
212
  <div class="license-key-field">
213
  <input id="alm_unlimited_license_key" name="alm_unlimited_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_unlimited_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
214
  <?php if( $alm_unlimited_status !== false && $alm_unlimited_status == 'valid' ) { ?>
@@ -264,7 +263,7 @@
264
  <form method="post" action="options.php">
265
 
266
  <?php settings_fields('alm_layouts_license'); ?>
267
- <label class="description" for="alm_layouts_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
268
  <div class="license-key-field">
269
  <input id="alm_layouts_license_key" name="alm_layouts_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_layouts_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
270
  <?php if( $alm_layouts_status !== false && $alm_layouts_status == 'valid' ) { ?>
@@ -320,7 +319,7 @@
320
  <form method="post" action="options.php">
321
 
322
  <?php settings_fields('alm_paging_license'); ?>
323
- <label class="description" for="alm_paging_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
324
  <div class="license-key-field">
325
  <input id="alm_paging_license_key" name="alm_paging_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_paging_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
326
  <?php if( $alm_paging_status !== false && $alm_paging_status == 'valid' ) { ?>
@@ -374,7 +373,7 @@
374
  <form method="post" action="options.php">
375
 
376
  <?php settings_fields('alm_preloaded_license'); ?>
377
- <label class="description" for="alm_preloaded_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
378
  <div class="license-key-field">
379
  <input id="alm_preloaded_license_key" name="alm_preloaded_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_preloaded_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
380
  <?php if( $alm_preloaded_status !== false && $alm_preloaded_status == 'valid' ) { ?>
@@ -427,7 +426,7 @@
427
  <form method="post" action="options.php">
428
 
429
  <?php settings_fields('alm_prev_post_license'); ?>
430
- <label class="description" for="alm_prev_post_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
431
  <div class="license-key-field">
432
  <input id="alm_prev_post_license_key" name="alm_prev_post_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_prev_post_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
433
  <?php if( $alm_prev_post_status !== false && $alm_prev_post_status == 'valid' ) { ?>
@@ -482,7 +481,7 @@
482
  <form method="post" action="options.php">
483
 
484
  <?php settings_fields('alm_rest_api_license'); ?>
485
- <label class="description" for="alm_rest_api_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
486
  <div class="license-key-field">
487
  <input id="alm_rest_api_license_key" name="alm_rest_api_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_restapi_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
488
  <?php if( $alm_restapi_status !== false && $alm_restapi_status == 'valid' ) { ?>
@@ -537,7 +536,7 @@
537
  <form method="post" action="options.php">
538
 
539
  <?php settings_fields('alm_seo_license'); ?>
540
- <label class="description" for="alm_seo_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
541
  <div class="license-key-field">
542
  <input id="alm_seo_license_key" name="alm_seo_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_seo_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
543
  <?php if( $alm_seo_status !== false && $alm_seo_status == 'valid' ) { ?>
@@ -594,7 +593,7 @@
594
  <form method="post" action="options.php">
595
 
596
  <?php settings_fields('alm_theme_repeaters_license'); ?>
597
- <label class="description" for="alm_theme_repeaters_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
598
  <div class="license-key-field">
599
  <input id="alm_theme_repeaters_license_key" name="alm_theme_repeaters_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_theme_repeaters_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
600
  <?php if( $alm_theme_repeaters_status !== false && $alm_theme_repeaters_status == 'valid' ) { ?>
11
  <p><?php _e('Manage your Ajax Load More license key\'s below - enter a key for each of your add-ons to receive plugin update notifications directly within the <a href="plugins.php">WP Plugins dashboard</a>.', 'ajax-load-more'); ?></p>
12
 
13
  <?php
 
14
  // alm_cache_installed
15
+ // alm_cta_installed
16
  // alm_comments_installed
17
  // alm_unlimited_installed
18
  // alm_layouts_installed
26
 
27
  <?php
28
  // Check if any add ons are installed.
29
+ if(has_action('alm_cache_installed') || has_action('alm_cta_installed') || has_action('alm_comments_installed') || has_action('alm_unlimited_installed') || has_action('alm_layouts_installed') || has_action('alm_preload_installed') || has_action('alm_paging_installed') || has_action('alm_prev_post_installed') || has_action('alm_rest_api_installed') || has_action('alm_seo_installed') || has_action('alm_theme_repeaters_installed')) : ?>
30
+
31
 
32
  <?php
33
+ if (has_action('alm_cache_installed')){
34
  // CACHE
35
+ $alm_cache_license = get_option( 'alm_cache_license_key' );
36
+ $alm_cache_status = get_option( 'alm_cache_license_status' );
37
  ?>
38
+ <div class="license" id="license-cache">
39
  <div class="license-title">
40
+ <div class="status <?php if($alm_cache_status == 'valid'){echo 'valid';}else{echo 'invalid';} ?> "></div>
41
+ <h2><?php _e('Cache', 'ajax-load-more'); ?></h2>
42
  </div>
43
  <div class="license-wrap">
44
  <form method="post" action="options.php">
45
 
46
+ <?php settings_fields('alm_cache_license'); ?>
47
+ <label class="description offscreen" for="alm_cache_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
48
  <div class="license-key-field">
49
+ <input id="alm_cache_license_key" name="alm_cache_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_cache_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
50
+ <?php if( $alm_cache_status !== false && $alm_cache_status == 'valid' ) { ?>
51
  <span class="status active">
52
  <?php _e('Active', 'ajax-load-more'); ?>
53
  </span>
58
  <?php } ?>
59
  </div>
60
 
61
+ <?php wp_nonce_field( 'alm_cache_license_nonce', 'alm_cache_license_nonce' ); ?>
62
  <div class="license-btn-wrap"
63
+ data-name="<?php echo ALM_CACHE_ITEM_NAME; ?>"
64
  data-url="<?php echo ALM_STORE_URL; ?>"
65
+ data-option-status="alm_cache_license_status"
66
+ data-option-key="alm_cache_license_key"
67
+ data-upgrade-url="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/">
68
+ <button type="button" class="activate license-btn <?php if($alm_cache_status === 'valid'){ echo 'hide'; } ?> button-primary" data-type="activate">
69
  <?php _e('Activate License', 'ajax-load-more'); ?>
70
  </button>
71
 
72
+ <button type="button" class="deactivate license-btn <?php if($alm_cache_status !== 'valid'){ echo 'hide'; } ?> button-secondary" data-type="deactivate">
73
  <?php _e('Deactivate License', 'ajax-load-more'); ?>
74
  </button>
75
  </div>
80
  </div>
81
  <?php
82
  }
83
+ // End CACHE
84
  ?>
85
 
 
86
  <?php
87
+ if (has_action('alm_cta_installed')){
88
+ // Call to Actions
89
+ $alm_cta_license = get_option( 'alm_cta_license_key' );
90
+ $alm_cta_status = get_option( 'alm_cta_license_status' );
91
  ?>
92
+ <div class="license" id="license-cta">
93
  <div class="license-title">
94
+ <div class="status <?php if($alm_cta_status == 'valid'){echo 'valid';}else{echo 'invalid';} ?> "></div>
95
+ <h2><?php _e('Call to Actions', 'ajax-load-more'); ?></h2>
96
  </div>
97
  <div class="license-wrap">
98
  <form method="post" action="options.php">
99
 
100
+ <?php settings_fields('alm_cta_license'); ?>
101
+ <label class="description offscreen" for="alm_cta_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
102
  <div class="license-key-field">
103
+ <input id="alm_cta_license_key" name="alm_cta_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_cta_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
104
+ <?php if( $alm_cta_status !== false && $alm_cta_status == 'valid' ) { ?>
105
  <span class="status active">
106
  <?php _e('Active', 'ajax-load-more'); ?>
107
  </span>
112
  <?php } ?>
113
  </div>
114
 
115
+ <?php wp_nonce_field( 'alm_cta_license_nonce', 'alm_cta_license_nonce' ); ?>
116
  <div class="license-btn-wrap"
117
+ data-name="<?php echo ALM_CTA_ITEM_NAME; ?>"
118
  data-url="<?php echo ALM_STORE_URL; ?>"
119
+ data-option-status="alm_cta_license_status"
120
+ data-option-key="alm_cta_license_key"
121
+ data-upgrade-url="https://connekthq.com/plugins/ajax-load-more/add-ons/call-to-actions/">
122
+ <button type="button" class="activate license-btn <?php if($alm_cta_status === 'valid'){ echo 'hide'; } ?> button-primary" data-type="activate">
123
  <?php _e('Activate License', 'ajax-load-more'); ?>
124
  </button>
125
 
126
+ <button type="button" class="deactivate license-btn <?php if($alm_cta_status !== 'valid'){ echo 'hide'; } ?> button-secondary" data-type="deactivate">
127
  <?php _e('Deactivate License', 'ajax-load-more'); ?>
128
  </button>
129
  </div>
134
  </div>
135
  <?php
136
  }
137
+ // End Call to Actions
138
  ?>
139
 
140
  <?php
152
  <form method="post" action="options.php">
153
 
154
  <?php settings_fields('alm_comments_license'); ?>
155
+ <label class="description offscreen" for="alm_comments_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
156
  <div class="license-key-field">
157
  <input id="alm_comments_license_key" name="alm_comments_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_comments_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
158
  <?php if( $alm_comments_status !== false && $alm_comments_status == 'valid' ) { ?>
207
  <form method="post" action="options.php">
208
 
209
  <?php settings_fields('alm_unlimited_license'); ?>
210
+ <label class="description offscreen" for="alm_unlimited_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
211
  <div class="license-key-field">
212
  <input id="alm_unlimited_license_key" name="alm_unlimited_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_unlimited_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
213
  <?php if( $alm_unlimited_status !== false && $alm_unlimited_status == 'valid' ) { ?>
263
  <form method="post" action="options.php">
264
 
265
  <?php settings_fields('alm_layouts_license'); ?>
266
+ <label class="description offscreen" for="alm_layouts_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
267
  <div class="license-key-field">
268
  <input id="alm_layouts_license_key" name="alm_layouts_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_layouts_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
269
  <?php if( $alm_layouts_status !== false && $alm_layouts_status == 'valid' ) { ?>
319
  <form method="post" action="options.php">
320
 
321
  <?php settings_fields('alm_paging_license'); ?>
322
+ <label class="description offscreen" for="alm_paging_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
323
  <div class="license-key-field">
324
  <input id="alm_paging_license_key" name="alm_paging_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_paging_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
325
  <?php if( $alm_paging_status !== false && $alm_paging_status == 'valid' ) { ?>
373
  <form method="post" action="options.php">
374
 
375
  <?php settings_fields('alm_preloaded_license'); ?>
376
+ <label class="description offscreen" for="alm_preloaded_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
377
  <div class="license-key-field">
378
  <input id="alm_preloaded_license_key" name="alm_preloaded_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_preloaded_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
379
  <?php if( $alm_preloaded_status !== false && $alm_preloaded_status == 'valid' ) { ?>
426
  <form method="post" action="options.php">
427
 
428
  <?php settings_fields('alm_prev_post_license'); ?>
429
+ <label class="description offscreen" for="alm_prev_post_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
430
  <div class="license-key-field">
431
  <input id="alm_prev_post_license_key" name="alm_prev_post_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_prev_post_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
432
  <?php if( $alm_prev_post_status !== false && $alm_prev_post_status == 'valid' ) { ?>
481
  <form method="post" action="options.php">
482
 
483
  <?php settings_fields('alm_rest_api_license'); ?>
484
+ <label class="description offscreen" for="alm_rest_api_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
485
  <div class="license-key-field">
486
  <input id="alm_rest_api_license_key" name="alm_rest_api_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_restapi_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
487
  <?php if( $alm_restapi_status !== false && $alm_restapi_status == 'valid' ) { ?>
536
  <form method="post" action="options.php">
537
 
538
  <?php settings_fields('alm_seo_license'); ?>
539
+ <label class="description offscreen" for="alm_seo_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
540
  <div class="license-key-field">
541
  <input id="alm_seo_license_key" name="alm_seo_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_seo_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
542
  <?php if( $alm_seo_status !== false && $alm_seo_status == 'valid' ) { ?>
593
  <form method="post" action="options.php">
594
 
595
  <?php settings_fields('alm_theme_repeaters_license'); ?>
596
+ <label class="description offscreen" for="alm_theme_repeaters_license_key"><?php _e('Enter License Key', 'ajax-load-more'); ?></label>
597
  <div class="license-key-field">
598
  <input id="alm_theme_repeaters_license_key" name="alm_theme_repeaters_license_key" type="text" class="regular-text" value="<?php esc_attr_e( $alm_theme_repeaters_license ); ?>" placeholder="<?php _e('Enter License Key', 'ajax-load-more'); ?>" />
599
  <?php if( $alm_theme_repeaters_status !== false && $alm_theme_repeaters_status == 'valid' ) { ?>
admin/views/settings.php CHANGED
@@ -12,8 +12,9 @@
12
  <div class="cnkt-main">
13
 
14
  <?php
15
- $alm_dismiss_sharing = get_transient( 'alm_dismiss_sharing');
16
- if($alm_dismiss_sharing !== 'true'){
 
17
  ?>
18
  <div class="group share-alm">
19
  <div class="dotted">
12
  <div class="cnkt-main">
13
 
14
  <?php
15
+ $alm_dismiss_sharing = get_transient( 'alm_dismiss_sharing');
16
+ if(!isset($alm_dismiss_sharing)){
17
+ // If transient has not been set - display this notice.
18
  ?>
19
  <div class="group share-alm">
20
  <div class="dotted">
ajax-load-more.php CHANGED
@@ -7,14 +7,14 @@ Text Domain: ajax-load-more
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
- Version: 2.11.1
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
- define('ALM_VERSION', '2.11.1');
17
- define('ALM_RELEASE', 'May 30, 2016');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
 
@@ -147,8 +147,8 @@ if( !class_exists('AjaxLoadMore') ):
147
  define('ALM_NAME', '_ajax_load_more');
148
  define('ALM_TITLE', 'Ajax Load More');
149
 
150
- if (!defined('ALM_ALTERNATING_ITEM_NAME')) define('ALM_ALTERNATING_ITEM_NAME', '14456');
151
  if (!defined('ALM_CACHE_ITEM_NAME')) define('ALM_CACHE_ITEM_NAME', '4878');
 
152
  if (!defined('ALM_COMMENTS_ITEM_NAME')) define('ALM_COMMENTS_ITEM_NAME', '12172');
153
  if (!defined('ALM_UNLIMITED_ITEM_NAME')) define('ALM_UNLIMITED_ITEM_NAME', '3118');
154
  if (!defined('ALM_LAYOUTS_ITEM_NAME')) define('ALM_LAYOUTS_ITEM_NAME', '11398');
@@ -253,9 +253,7 @@ if( !class_exists('AjaxLoadMore') ):
253
 
254
  //$file = plugins_url('/core/css/ajax-load-more.css', __FILE__ );
255
  $file = plugins_url('/core/css/ajax-load-more.min.css', __FILE__ );
256
-
257
- $filename = 'ajax-load-more';
258
- ALM_ENQUEUE::alm_enqueue_css($filename, $file);
259
 
260
  }
261
 
@@ -327,19 +325,6 @@ if( !class_exists('AjaxLoadMore') ):
327
  $type = alm_get_repeater_type($repeater);
328
  $theme_repeater = (isset($_GET['theme_repeater'])) ? $_GET['theme_repeater'] : 'null';
329
 
330
- // Alternate Template data array - from ajax-load-more.js
331
- $alternate = false;
332
- $alternateData = (isset($_GET['alternate'])) ? $_GET['alternate'] : '';
333
- if($alternateData){
334
- $alternate = true;
335
- $alternate_sequence = (isset($alternateData['alternate_sequence'])) ? $alternateData['alternate_sequence'] : '';
336
- $alternate_sequence_max = (isset($alternateData['alternate_sequence_max'])) ? $alternateData['alternate_sequence_max'] : '9999';
337
- if($alternate_sequence_max === '0')
338
- $alternate_sequence_max = '9999';
339
- $alternate_repeater = (isset($alternateData['alternate_repeater'])) ? $alternateData['alternate_repeater'] : 'null';
340
- $alternate_theme_repeater = (isset($alternateData['alternate_theme_repeater'])) ? $alternateData['alternate_theme_repeater'] : 'null';
341
- }
342
-
343
  $postType = (isset($_GET['post_type'])) ? $_GET['post_type'] : 'post';
344
  $post_format = (isset($_GET['post_format'])) ? $_GET['post_format'] : '';
345
 
@@ -398,9 +383,9 @@ if( !class_exists('AjaxLoadMore') ):
398
  }
399
 
400
 
401
- // Page
402
  $posts_per_page = (isset($_GET['posts_per_page'])) ? $_GET['posts_per_page'] : 5;
403
- $page = (isset($_GET['page'])) ? $_GET['page'] : 0;
404
 
405
  // Preload Add-on
406
  $preloaded = (isset($_GET['preloaded'])) ? $_GET['preloaded'] : 'false';
@@ -411,20 +396,43 @@ if( !class_exists('AjaxLoadMore') ):
411
  $offset = $offset + $preloaded_amount;
412
  }
413
 
414
- //Previous Post Add-on
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  $is_previous_post = (isset($_GET['previous_post'])) ? $_GET['previous_post'] : false;
416
  $previous_post_id = (isset($_GET['previous_post_id'])) ? $_GET['previous_post_id'] : '';
417
 
418
  // Paging Add-on
419
  $paging = (isset($_GET['paging'])) ? $_GET['paging'] : false;
420
 
421
- //SEO Add-on
422
  $seo_start_page = (isset($_GET['seo_start_page'])) ? $_GET['seo_start_page'] : 1;
423
 
424
- // Language (Is this needed?)
425
  $lang = (isset($_GET['lang'])) ? $_GET['lang'] : '';
426
 
427
- // Set up initial args
428
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
429
  $args = array(
430
  'post_type' => $postType,
@@ -636,12 +644,11 @@ if( !class_exists('AjaxLoadMore') ):
636
  // Hijack $args and and return previous post only
637
  if($is_previous_post == 'true' && has_action('alm_prev_post_installed')){
638
  $args = apply_filters('alm_prev_post_args', $previous_post_id, $postType);
639
- }
640
 
641
- $args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
642
-
643
- // WP_Query()
644
- $alm_query = new WP_Query( $args );
645
 
646
  // If preload, set our loop count and total posts to
647
  if(has_action('alm_preload_installed') && $preloaded === 'true'){
@@ -661,61 +668,56 @@ if( !class_exists('AjaxLoadMore') ):
661
  $page_cache = ''; // set our page cache variable
662
  }
663
 
664
- // Alternating Templates
665
- if($alternate && has_action('alm_alternating_installed')){
666
- $alternate_sequence_array = '';
667
- if($alternate_sequence === 'even'){
668
- $alternate_sequence_array = 'even';
669
- }else{
670
- $alternate_sequence_array = explode(',', $alternate_sequence);
671
- }
672
- $global_repeater = $repeater;
673
- $global_type = $type;
674
- $global_theme_repeater = $theme_repeater;
675
- }
676
-
677
 
678
  if($queryType === 'standard'){
679
 
680
  // Run the loop
681
  if ($alm_query->have_posts()) :
682
- $alm_found_posts = $alm_total_posts;
683
- $alm_current = 0;
 
 
 
 
 
 
 
 
684
 
685
  ob_start();
686
-
 
687
  while ($alm_query->have_posts()): $alm_query->the_post();
688
 
689
  $alm_loop_count++;
690
  $alm_current++;
691
  $alm_page = $alm_page_count; // Get page number
692
- $alm_item = ($alm_page_count * $posts_per_page) - $posts_per_page + $alm_loop_count; // Get current item
693
-
694
- // Alternating Templates
695
- if($alternate && has_action('alm_alternating_installed') && $alm_page <= $alternate_sequence_max){
696
- if (function_exists('alm_alternate_is_in_array')) {
697
- if(alm_alternate_is_in_array($alm_current, $alternate_sequence_array)){ // If $alm_current is found in array
698
- if($alternate_theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
699
- $theme_repeater = $alternate_theme_repeater;
700
- }else{
701
- $repeater = $alternate_repeater;
702
- $type = alm_get_repeater_type($repeater);
703
- }
704
- }else{ // Reset $repeater values
705
- $repeater = $global_repeater;
706
- $type = $global_type;
707
- $theme_repeater = $global_theme_repeater;
708
- }
709
- }
710
- }
711
-
712
- if($theme_repeater != 'null' && has_action('alm_get_theme_repeater')){
713
- do_action('alm_get_theme_repeater', $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current); // Theme Repeater
714
  }else{
715
- include( alm_get_current_repeater($repeater, $type) ); //Include repeater template
716
  }
 
 
 
 
 
 
 
 
 
717
 
718
  endwhile; wp_reset_query();
 
719
 
720
  $data = ob_get_clean();
721
 
@@ -726,22 +728,30 @@ if( !class_exists('AjaxLoadMore') ):
726
  }
727
 
728
  $return = array(
729
- 'html' => $data
 
 
 
 
730
  );
731
-
732
  wp_send_json($return);
733
 
734
  else :
735
 
736
  $return = array(
737
- 'html' => null
 
738
  );
 
739
  wp_send_json($return);
740
 
741
  endif;
742
 
743
  }elseif($queryType === 'totalposts'){
744
- echo $alm_total_posts;
 
 
745
  }
746
 
747
  wp_die();
@@ -764,9 +774,8 @@ if( !class_exists('AjaxLoadMore') ):
764
  $ajax_load_more = new AjaxLoadMore();
765
 
766
  return $ajax_load_more;
767
- }
768
- // initialize
769
- AjaxLoadMore();
770
 
771
 
772
  endif; // class_exists check
7
  Author: Darren Cooney
8
  Twitter: @KaptonKaos
9
  Author URI: http://connekthq.com
10
+ Version: 2.11.2
11
  License: GPL
12
  Copyright: Darren Cooney & Connekt Media
13
  */
14
 
15
 
16
+ define('ALM_VERSION', '2.11.2');
17
+ define('ALM_RELEASE', 'August 4, 2016');
18
  define('ALM_STORE_URL', 'https://connekthq.com');
19
 
20
 
147
  define('ALM_NAME', '_ajax_load_more');
148
  define('ALM_TITLE', 'Ajax Load More');
149
 
 
150
  if (!defined('ALM_CACHE_ITEM_NAME')) define('ALM_CACHE_ITEM_NAME', '4878');
151
+ if (!defined('ALM_CTA_ITEM_NAME')) define('ALM_CTA_ITEM_NAME', '14456');
152
  if (!defined('ALM_COMMENTS_ITEM_NAME')) define('ALM_COMMENTS_ITEM_NAME', '12172');
153
  if (!defined('ALM_UNLIMITED_ITEM_NAME')) define('ALM_UNLIMITED_ITEM_NAME', '3118');
154
  if (!defined('ALM_LAYOUTS_ITEM_NAME')) define('ALM_LAYOUTS_ITEM_NAME', '11398');
253
 
254
  //$file = plugins_url('/core/css/ajax-load-more.css', __FILE__ );
255
  $file = plugins_url('/core/css/ajax-load-more.min.css', __FILE__ );
256
+ ALM_ENQUEUE::alm_enqueue_css('ajax-load-more', $file);
 
 
257
 
258
  }
259
 
325
  $type = alm_get_repeater_type($repeater);
326
  $theme_repeater = (isset($_GET['theme_repeater'])) ? $_GET['theme_repeater'] : 'null';
327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  $postType = (isset($_GET['post_type'])) ? $_GET['post_type'] : 'post';
329
  $post_format = (isset($_GET['post_format'])) ? $_GET['post_format'] : '';
330
 
383
  }
384
 
385
 
386
+ // Page Parameters
387
  $posts_per_page = (isset($_GET['posts_per_page'])) ? $_GET['posts_per_page'] : 5;
388
+ $page = (isset($_GET['page'])) ? $_GET['page'] : 0;
389
 
390
  // Preload Add-on
391
  $preloaded = (isset($_GET['preloaded'])) ? $_GET['preloaded'] : 'false';
396
  $offset = $offset + $preloaded_amount;
397
  }
398
 
399
+ // CTA Add-on
400
+ $cta = false;
401
+ $ctaData = (isset($_GET['cta'])) ? $_GET['cta'] : '';
402
+ if($ctaData){
403
+ $cta = true;
404
+ $cta_position = (isset($ctaData['cta_position'])) ? $ctaData['cta_position'] : 'before:1:0';
405
+ $cta_position_array = explode(":", $cta_position);
406
+ $cta_pos = (string)$cta_position_array[0];
407
+ $cta_val = (string)$cta_position_array[1];
408
+ $cta_repeat = (string)$cta_position_array[2];
409
+ if($cta_repeat == 0){
410
+ $cta_repeat = 9999;
411
+ }
412
+ if($preloaded == 'true'){
413
+ $cta_repeat = $cta_repeat - 1;
414
+ }
415
+ if($cta_pos != 'after'){
416
+ $cta_pos = 'before';
417
+ }
418
+ $cta_repeater = (isset($ctaData['cta_repeater'])) ? $ctaData['cta_repeater'] : 'null';
419
+ $cta_theme_repeater = (isset($ctaData['cta_theme_repeater'])) ? $ctaData['cta_theme_repeater'] : 'null';
420
+ }
421
+
422
+ // Previous Post Add-on
423
  $is_previous_post = (isset($_GET['previous_post'])) ? $_GET['previous_post'] : false;
424
  $previous_post_id = (isset($_GET['previous_post_id'])) ? $_GET['previous_post_id'] : '';
425
 
426
  // Paging Add-on
427
  $paging = (isset($_GET['paging'])) ? $_GET['paging'] : false;
428
 
429
+ // SEO Add-on
430
  $seo_start_page = (isset($_GET['seo_start_page'])) ? $_GET['seo_start_page'] : 1;
431
 
432
+ // Language (Is this required?)
433
  $lang = (isset($_GET['lang'])) ? $_GET['lang'] : '';
434
 
435
+ // Set up initial query arguments
436
  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
437
  $args = array(
438
  'post_type' => $postType,
644
  // Hijack $args and and return previous post only
645
  if($is_previous_post == 'true' && has_action('alm_prev_post_installed')){
646
  $args = apply_filters('alm_prev_post_args', $previous_post_id, $postType);
647
+ }
648
 
649
+ $args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
650
+
651
+ $alm_query = new WP_Query( $args ); // WP_Query()
 
652
 
653
  // If preload, set our loop count and total posts to
654
  if(has_action('alm_preload_installed') && $preloaded === 'true'){
668
  $page_cache = ''; // set our page cache variable
669
  }
670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
671
 
672
  if($queryType === 'standard'){
673
 
674
  // Run the loop
675
  if ($alm_query->have_posts()) :
676
+
677
+ $alm_found_posts = $alm_total_posts;
678
+ $alm_post_count = $alm_query->post_count;
679
+ $alm_current = 0;
680
+ $alm_has_cta = false;
681
+
682
+ $cta_array = Array();
683
+ if($cta && has_action('alm_cta_pos_array')){ // Build CTA Position Array
684
+ $cta_array = apply_filters('alm_cta_pos_array', $seo_start_page, $page, $posts_per_page, $alm_post_count, $cta_val, $cta_repeat);
685
+ }
686
 
687
  ob_start();
688
+
689
+ // ALM Loop
690
  while ($alm_query->have_posts()): $alm_query->the_post();
691
 
692
  $alm_loop_count++;
693
  $alm_current++;
694
  $alm_page = $alm_page_count; // Get page number
695
+ $alm_item = ($alm_page_count * $posts_per_page) - $posts_per_page + $alm_loop_count; // Get current item
696
+
697
+ // Call to Action [Before]
698
+ if($cta && has_action('alm_cta_inc') && $cta_pos == 'before' && in_array($alm_current, $cta_array)){
699
+ do_action('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $type, $alm_found_posts, $alm_page, $alm_item, $alm_current);
700
+ $alm_has_cta = true;
701
+ }
702
+
703
+ // Repeater Template
704
+ if($theme_repeater != 'null' && has_action('alm_get_theme_repeater')){ // Theme Repeater
705
+ do_action('alm_get_theme_repeater', $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
 
 
 
 
 
 
 
 
 
 
 
706
  }else{
707
+ include(alm_get_current_repeater( $repeater, $type )); //Include repeater template
708
  }
709
+ // End Repeater Template
710
+
711
+
712
+ // Call to Action [After]
713
+ if($cta && has_action('alm_cta_inc') && $cta_pos == 'after' && in_array($alm_current, $cta_array)){
714
+ do_action('alm_cta_inc', $cta_repeater, $cta_theme_repeater, $type, $alm_found_posts, $alm_page, $alm_item, $alm_current);
715
+ $alm_has_cta = true;
716
+ }
717
+
718
 
719
  endwhile; wp_reset_query();
720
+ // End ALM Loop
721
 
722
  $data = ob_get_clean();
723
 
728
  }
729
 
730
  $return = array(
731
+ 'html' => $data,
732
+ 'meta' => array(
733
+ 'postcount' => $alm_post_count,
734
+ 'totalposts' => $alm_found_posts
735
+ )
736
  );
737
+
738
  wp_send_json($return);
739
 
740
  else :
741
 
742
  $return = array(
743
+ 'html' => null,
744
+ 'meta' => null
745
  );
746
+
747
  wp_send_json($return);
748
 
749
  endif;
750
 
751
  }elseif($queryType === 'totalposts'){
752
+
753
+ echo $alm_total_posts; // Paging add-on
754
+
755
  }
756
 
757
  wp_die();
774
  $ajax_load_more = new AjaxLoadMore();
775
 
776
  return $ajax_load_more;
777
+ }
778
+ AjaxLoadMore(); // initialize
 
779
 
780
 
781
  endif; // class_exists check
core/classes/class.alm-shortcode.php CHANGED
@@ -15,10 +15,8 @@ if ( ! defined( 'ABSPATH' ) ) {
15
  if( !class_exists('ALM_SHORTCODE') ):
16
 
17
  class ALM_SHORTCODE {
18
-
19
-
20
- static $counter = 0;
21
-
22
 
23
  /**
24
  * alm_render_shortcode
@@ -80,11 +78,10 @@ if( !class_exists('ALM_SHORTCODE') ):
80
  'seo' => 'false',
81
  'repeater' => 'default',
82
  'theme_repeater' => 'null',
83
- 'alternate' => false,
84
- 'alternate_sequence' => '',
85
- 'alternate_sequence_max' => '0',
86
- 'alternate_repeater' => 'null',
87
- 'alternate_theme_repeater' => 'null',
88
  'post_type' => 'post',
89
  'post_format' => '',
90
  'category' => '',
@@ -155,8 +152,7 @@ if( !class_exists('ALM_SHORTCODE') ):
155
  $transition_container = "true";
156
 
157
  if($restapi === 'true'){
158
- $restapi = true;
159
-
160
  $preloaded = false;
161
  }
162
 
@@ -225,7 +221,7 @@ if( !class_exists('ALM_SHORTCODE') ):
225
  $paging_container_class = '';
226
  if($paging === 'true'){
227
  $paging_container_class = ' alm-paging-wrap';
228
- $preloaded = "false";
229
  }
230
 
231
 
@@ -233,68 +229,15 @@ if( !class_exists('ALM_SHORTCODE') ):
233
  $ajaxloadmore = '';
234
 
235
  $ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
236
-
237
- // Build canonical URL
238
- // - Check the page/post type and then get the correct base url for the page.
239
-
240
- // Date
241
- if(is_date()){
242
- // Is archive page
243
- $archive_year = get_the_date('Y');
244
- $archive_month = get_the_date('m');
245
- $archive_day = get_the_date('d');
246
- if(is_year()){
247
- $canonicalURL = get_year_link( $archive_year );
248
- }
249
- if(is_month()){
250
- $canonicalURL = get_month_link( $archive_year, $archive_month );
251
- }
252
- if(is_day()){
253
- $canonicalURL = get_month_link( $archive_year, $archive_month, $archive_day );
254
- }
255
- }
256
- // Frontpage
257
- elseif(is_front_page()){
258
- $canonicalURL = get_home_url().'/';
259
- }
260
- // Home (Blog Default)
261
- elseif(is_home()){
262
- $canonicalURL = get_permalink(get_option('page_for_posts'));
263
- }
264
- // Category
265
- elseif(is_category()){
266
- $cur_cat_id = get_cat_id( single_cat_title('',false) );
267
- $canonicalURL = get_category_link($cur_cat_id);
268
- }
269
- // Tag
270
- elseif(is_tag()){
271
- $cur_tag_id = get_query_var('tag_id');
272
- $canonicalURL = get_tag_link($cur_tag_id);
273
- }
274
- // Author
275
- elseif(is_author()){
276
- $author_id = get_the_author_meta('ID');
277
- $canonicalURL = get_author_posts_url($author_id);
278
- }
279
- // Taxonomy
280
- elseif(is_tax()){
281
- $tax_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy' ));
282
- $tax_id = $tax_term->term_id;
283
- $canonicalURL = get_term_link($tax_id);
284
- }
285
- // post_type
286
- elseif(is_post_type_archive()){
287
- $post_type_archive = get_post_type();
288
- $canonicalURL = get_post_type_archive_link($post_type_archive);
289
- }
290
- else{
291
- $canonicalURL = get_permalink();
292
- }
293
- // End build canonical URL
294
-
295
 
296
  // ALM Wrapper
297
- $ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'. $canonicalURL .'" data-slug="'. $slug .'">';
 
 
 
 
298
 
299
 
300
  // Previous Post
@@ -339,7 +282,17 @@ if( !class_exists('ALM_SHORTCODE') ):
339
  if($paged > 1){
340
  $preload_offset = $preloaded_amount * ($paged-2);
341
  }
342
- }
 
 
 
 
 
 
 
 
 
 
343
 
344
  $preloaded_arr = array( // Create preload data array
345
  'comments' => $comments,
@@ -391,20 +344,7 @@ if( !class_exists('ALM_SHORTCODE') ):
391
  $alm_preload_query = new WP_Query($args);
392
  $alm_total_posts = $alm_preload_query->found_posts - $offset;
393
  $output = '';
394
- $noscript = '';
395
-
396
- // Alternating Templates
397
- if($alternate === 'true' && has_action('alm_alternating_installed')){
398
- $alternate_sequence_array = '';
399
- if($alternate_sequence === 'even'){
400
- $alternate_sequence_array = 'even';
401
- }else{
402
- $alternate_sequence_array = explode(',', $alternate_sequence);
403
- }
404
- $global_repeater = $repeater;
405
- $global_type = $type;
406
- $global_theme_repeater = $theme_repeater;
407
- }
408
 
409
  if ($alm_preload_query->have_posts()) :
410
  $alm_loop_count = 0; // Count var
@@ -412,30 +352,27 @@ if( !class_exists('ALM_SHORTCODE') ):
412
  $alm_found_posts = $alm_total_posts;
413
  $alm_current = 0;
414
  while ($alm_preload_query->have_posts()) : $alm_preload_query->the_post();
 
415
  $alm_loop_count++;
416
  $alm_current++;
417
- $alm_item = $alm_loop_count; // Get current item in loop
418
-
419
- // Alternating Templates
420
- if($alternate === 'true' && has_action('alm_alternating_installed')){
421
- if (function_exists('alm_alternate_is_in_array')) {
422
- if(alm_alternate_is_in_array($alm_current, $alternate_sequence_array)){ // If $alm_current is found in array
423
- if($alternate_theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
424
- $theme_repeater = $alternate_theme_repeater;
425
- }else{
426
- $repeater = $alternate_repeater;
427
- $type = alm_get_repeater_type($repeater);
428
- }
429
- }else{ // Reset $repeater values
430
- $repeater = $global_repeater;
431
- $type = $global_type;
432
- $theme_repeater = $global_theme_repeater;
433
- }
434
- }
435
- }
436
-
437
- $output .= apply_filters('alm_preload_inc', $repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
438
-
439
  endwhile; wp_reset_query();
440
 
441
  if(has_action('alm_seo_installed') && $seo === 'true'){ // If SEO, add noscript paging
@@ -446,23 +383,22 @@ if( !class_exists('ALM_SHORTCODE') ):
446
  endif;
447
 
448
  $preloaded_output .= '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
449
- if($seo === "true") $preloaded_output .= '<div class="alm-reveal alm-seo" data-page="1" data-url="'.$canonicalURL.'">';
 
 
 
450
 
451
  $preloaded_output .= $output;
452
 
453
- if($seo === "true") $preloaded_output .= '</div>';
 
 
 
454
  $preloaded_output .= '</'.$container_element.'>';
455
 
456
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
457
  $preloaded_output .= $noscript;
458
  }
459
-
460
- // Reset templates (custom and theme) if $alternate is true
461
- if($alternate === 'true' && has_action('alm_alternating_installed')){
462
- $repeater = $global_repeater;
463
- $type = $global_type;
464
- $theme_repeater = $theme_repeater;
465
- }
466
  }
467
 
468
  // Preloaded Comments
@@ -496,19 +432,6 @@ if( !class_exists('ALM_SHORTCODE') ):
496
  $ajaxloadmore .= '<'.$container_element.' class="'.$listing_class.' alm-ajax'. $paging_container_class .' '. $classname . ' '. $css_classes .'"'; // Build ALM container
497
 
498
 
499
- // Alternating Templates Add-on
500
- if(has_action('alm_alternating_installed') && $alternate === 'true'){
501
- $alternate_return = apply_filters(
502
- 'alm_alternating_templates_shortcode',
503
- $alternate,
504
- $alternate_sequence,
505
- $alternate_sequence_max,
506
- $alternate_repeater,
507
- $alternate_theme_repeater
508
- );
509
- $ajaxloadmore .= $alternate_return;
510
- }
511
-
512
  // Cache Add-on
513
  if(has_action('alm_cache_installed') && $cache === 'true'){
514
  $cache_return = apply_filters(
@@ -518,6 +441,18 @@ if( !class_exists('ALM_SHORTCODE') ):
518
  $options
519
  );
520
  $ajaxloadmore .= $cache_return;
 
 
 
 
 
 
 
 
 
 
 
 
521
  }
522
 
523
  // Comments Add-on
@@ -664,7 +599,7 @@ if( !class_exists('ALM_SHORTCODE') ):
664
  $ajaxloadmore .= $previous_post_output; // Add $next_post_output data to $ajaxloadmore
665
 
666
  }
667
- // End Previous Post
668
 
669
 
670
  $ajaxloadmore .= '</'.$container_element.'>';
15
  if( !class_exists('ALM_SHORTCODE') ):
16
 
17
  class ALM_SHORTCODE {
18
+
19
+ static $counter = 0;
 
 
20
 
21
  /**
22
  * alm_render_shortcode
78
  'seo' => 'false',
79
  'repeater' => 'default',
80
  'theme_repeater' => 'null',
81
+ 'cta' => false,
82
+ 'cta_position' => 'before:1:0',
83
+ 'cta_repeater' => 'null',
84
+ 'cta_theme_repeater' => 'null',
 
85
  'post_type' => 'post',
86
  'post_format' => '',
87
  'category' => '',
152
  $transition_container = "true";
153
 
154
  if($restapi === 'true'){
155
+ $restapi = true;
 
156
  $preloaded = false;
157
  }
158
 
221
  $paging_container_class = '';
222
  if($paging === 'true'){
223
  $paging_container_class = ' alm-paging-wrap';
224
+ $preloaded = "false";
225
  }
226
 
227
 
229
  $ajaxloadmore = '';
230
 
231
  $ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
232
+
233
+ $canonicalURL = alm_get_canonical_url(); // Build canonical URL
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
  // ALM Wrapper
236
+ $id = 'ajax-load-more';
237
+ if(self::$counter > 1){
238
+ $id = '';
239
+ }
240
+ $ajaxloadmore .= '<div id="'. $id .'" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'. $canonicalURL .'" data-slug="'. $slug .'">';
241
 
242
 
243
  // Previous Post
282
  if($paged > 1){
283
  $preload_offset = $preloaded_amount * ($paged-2);
284
  }
285
+ }
286
+
287
+ // If CTA, parse $cta_position
288
+ if($cta){
289
+ $cta_pos_array = explode(":", $cta_position);
290
+ $cta_pos = (string)$cta_pos_array[0];
291
+ $cta_val = (string)$cta_pos_array[1];
292
+ if($cta_pos != 'after'){
293
+ $cta_pos = 'before';
294
+ }
295
+ }
296
 
297
  $preloaded_arr = array( // Create preload data array
298
  'comments' => $comments,
344
  $alm_preload_query = new WP_Query($args);
345
  $alm_total_posts = $alm_preload_query->found_posts - $offset;
346
  $output = '';
347
+ $noscript = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
  if ($alm_preload_query->have_posts()) :
350
  $alm_loop_count = 0; // Count var
352
  $alm_found_posts = $alm_total_posts;
353
  $alm_current = 0;
354
  while ($alm_preload_query->have_posts()) : $alm_preload_query->the_post();
355
+
356
  $alm_loop_count++;
357
  $alm_current++;
358
+ $alm_item = $alm_loop_count; // Get current item in loop
359
+
360
+ // Call to Action [Before]
361
+ if($cta && has_action('alm_cta_inc') && $cta_pos == 'before'){
362
+ if($alm_current == $cta_val){
363
+ $output .= apply_filters('alm_cta_preloaded_inc', $cta_repeater, $cta_theme_repeater, $type, $alm_found_posts, $alm_page, $alm_item, $alm_current);
364
+ }
365
+ }
366
+
367
+ $output .= apply_filters('alm_preload_inc', $repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
368
+
369
+ // Call to Action [After]
370
+ if($cta && has_action('alm_cta_inc') && $cta_pos == 'after'){
371
+ if($alm_current == $cta_val){
372
+ $output .= apply_filters('alm_cta_preloaded_inc', $cta_repeater, $cta_theme_repeater, $type, $alm_found_posts, $alm_page, $alm_item, $alm_current);
373
+ }
374
+ }
375
+
 
 
 
 
376
  endwhile; wp_reset_query();
377
 
378
  if(has_action('alm_seo_installed') && $seo === 'true'){ // If SEO, add noscript paging
383
  endif;
384
 
385
  $preloaded_output .= '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
386
+
387
+ if($seo === "true"){
388
+ $preloaded_output .= '<div class="alm-reveal alm-seo" data-page="1" data-url="'.$canonicalURL.'">';
389
+ }
390
 
391
  $preloaded_output .= $output;
392
 
393
+ if($seo === "true"){
394
+ $preloaded_output .= '</div>';
395
+ }
396
+
397
  $preloaded_output .= '</'.$container_element.'>';
398
 
399
  if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
400
  $preloaded_output .= $noscript;
401
  }
 
 
 
 
 
 
 
402
  }
403
 
404
  // Preloaded Comments
432
  $ajaxloadmore .= '<'.$container_element.' class="'.$listing_class.' alm-ajax'. $paging_container_class .' '. $classname . ' '. $css_classes .'"'; // Build ALM container
433
 
434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  // Cache Add-on
436
  if(has_action('alm_cache_installed') && $cache === 'true'){
437
  $cache_return = apply_filters(
441
  $options
442
  );
443
  $ajaxloadmore .= $cache_return;
444
+ }
445
+
446
+ // CTA Add-on
447
+ if(has_action('alm_cta_installed') && $cta === 'true'){
448
+ $cta_return = apply_filters(
449
+ 'alm_cta_shortcode',
450
+ $cta,
451
+ $cta_position,
452
+ $cta_repeater,
453
+ $cta_theme_repeater
454
+ );
455
+ $ajaxloadmore .= $cta_return;
456
  }
457
 
458
  // Comments Add-on
599
  $ajaxloadmore .= $previous_post_output; // Add $next_post_output data to $ajaxloadmore
600
 
601
  }
602
+ // / Previous Post Add-on
603
 
604
 
605
  $ajaxloadmore .= '</'.$container_element.'>';
core/functions.php CHANGED
@@ -16,7 +16,7 @@ function alm_get_current_repeater($repeater, $type) {
16
 
17
  // If is Custom Repeaters (Custom Repeaters v1)
18
  if( $type == 'repeater' && has_action('alm_repeater_installed' )){
19
- $include = ALM_REPEATER_PATH . 'repeaters/'. $template .'.php';
20
 
21
  if(!file_exists($include)) //confirm file exists
22
  alm_get_default_repeater();
@@ -40,6 +40,12 @@ function alm_get_current_repeater($repeater, $type) {
40
  // Default repeater
41
  else{
42
  $include = alm_get_default_repeater();
 
 
 
 
 
 
43
  }
44
 
45
  return $include;
@@ -295,11 +301,9 @@ function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_o
295
  * @since 2.5.0
296
  */
297
  function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
298
- if(!empty($meta_key)){
299
-
300
  $meta_values = alm_parse_meta_value($meta_value, $meta_compare);
301
- if(!empty($meta_values)){
302
-
303
  $return = array(
304
  'key' => $meta_key,
305
  'value' => $meta_values,
@@ -312,14 +316,10 @@ function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
312
  'key' => $meta_key,
313
  'compare' => $meta_compare,
314
  'type' => $meta_type
315
- );
316
-
317
- }
318
-
319
- return $return;
320
-
321
- }
322
-
323
  }
324
 
325
 
@@ -362,6 +362,76 @@ function alm_get_repeater_type($repeater){
362
 
363
 
364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  /*
366
  * alm_paging_no_script
367
  * Create paging navigation
@@ -416,9 +486,6 @@ function alm_paging_no_script($alm_preload_query){
416
  }
417
  $content .= '</div>';
418
  $content .= '</noscript>';
419
- }
420
-
421
  return $content;
422
  }
423
-
424
-
16
 
17
  // If is Custom Repeaters (Custom Repeaters v1)
18
  if( $type == 'repeater' && has_action('alm_repeater_installed' )){
19
+ $include = ALM_REPEATER_PATH . 'repeaters/'. $template .'.php';
20
 
21
  if(!file_exists($include)) //confirm file exists
22
  alm_get_default_repeater();
40
  // Default repeater
41
  else{
42
  $include = alm_get_default_repeater();
43
+ }
44
+
45
+ // Security check
46
+ // check if $template contains relative path. So, set include to default
47
+ if ( false !== strpos( $template, './' ) ) {
48
+ $include = alm_get_default_repeater();
49
  }
50
 
51
  return $include;
301
  * @since 2.5.0
302
  */
303
  function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
304
+ if(!empty($meta_key)){
 
305
  $meta_values = alm_parse_meta_value($meta_value, $meta_compare);
306
+ if(!empty($meta_values)){
 
307
  $return = array(
308
  'key' => $meta_key,
309
  'value' => $meta_values,
316
  'key' => $meta_key,
317
  'compare' => $meta_compare,
318
  'type' => $meta_type
319
+ );
320
+ }
321
+ return $return;
322
+ }