WordPress Infinite Scroll – Ajax Load More - Version 2.1.1

Version Description

  • Adding Order and Orderby query parameters, you can now set these values within the Shortcode Builder
  • Updating core javascript code
  • Fixed bug with taxonomy query selectors
Download this release

Release Info

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

Code changes from version 2.0.5 to 2.1.1

README.txt CHANGED
@@ -4,77 +4,99 @@ Donate link: http://connekthq.com/donate/
4
  Tags: ajax, query, loop, paging, filter, jquery, shortcode builder, shortcode, search, tags, category
5
  Requires at least: 3.6
6
  Tested up to: 3.9.1
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Ajax Load More is simple solution for lazy loading your WordPress posts and pages with AJAX.
12
 
13
  == Description ==
14
 
15
- A simple yet powerful solution for loading WordPress posts and pages via AJAX requests. Build complex WP queries using our shortcode builder and let Ajax Load More handle the rest.
 
 
16
 
17
 
18
- View live examples on the [demo site](http://connekthq.com/ajax-load-more/).
19
 
 
 
 
 
 
 
20
 
21
- = Features include =
22
 
23
- * **Shortcode/Query Builder** - create your own Ajax Load More shortcode by adjusting the various WordPress query parameters (see Shortcode Parameters)
24
- * **Customizable Repeater** - edit and extend the functionality of Ajax Load More by editing the repeater (see screenshots)
25
- * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots)
26
-
27
 
28
  = Shortcode Parameters =
29
 
30
- Ajax Load More accepts a number of paramaters to pass to the WordPress query. These parameters are passed via shortcode. Don't worry, it's super simple with our custom Shortcode Builder.
31
 
32
- * repeater - select from a list of customizable repeaters (Add-on available)
33
- * post_type - comma seperated list of post types to query
34
- * category - query by category slug
35
- * tag - query by tag slug
36
- * author - query by author id
37
- * search - query search term ('s')
38
- * exclude - comma separated list of post ID's to exclude from query.
39
- * offset - offset the initial query (number).
40
- * posts_per_page - number of posts to load with each request
41
- * scroll - load more posts as the user scrolls the page (true/false)
42
- * max_pages - maximum number of pages to load while scrolling (only if scroll == true)
43
- * pause - do not load posts until user clicks load button (true/false)
44
- * transition - select a loading transition from the drop menu (slide/fade)
45
- * button_label - customize the Load More button label.
 
 
 
 
 
46
 
47
 
48
  = Example Shortcode =
49
 
50
  [ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
 
53
  = Tested Browsers =
54
 
55
  * Firefox (mac + pc)
56
- * Safari (mac + pc)
57
- * Chrome (mac + pc)
58
  * IE8+
59
  * iPhone (Safari, Chrome)
60
  * Android (Native + Chrome)
61
  * BB10
62
 
63
 
64
- = Add-ons =
65
 
66
- The following Add-ons are available to increase the functionality of Ajax Load More.
 
67
 
68
- **Custom Repeaters**
69
- The Custom Repeaters add-on will add five additional customizeable repeaters and allow you to select unique repeaters for different content types throughout your theme.
70
- [More Information](http://connekthq.com/ajax-load-more/custom-repeaters)
71
 
72
- = Website =
73
- http://connekthq.com/ajax-load-more
74
 
 
 
 
75
 
76
- = Please Vote =
77
- Your votes make a big difference! If you like Ajax Load More, please vote for my plugin.
78
 
79
 
80
  == Frequently Asked Questions ==
@@ -90,11 +112,17 @@ Yes, Ajax Load more uses admin-ajax and nonces in order to protect URLs and form
90
 
91
  = Can I make modifications to the plugin code? =
92
 
93
- Sure, but please be aware that if any modifications are made may affect future updates.
 
 
 
 
94
 
95
- = Can I modify the repeater? =
96
 
97
- Yes, visit the Repeaters area in the WordPress admin.
 
 
98
 
99
  == Installation ==
100
 
@@ -134,6 +162,45 @@ How to install Ajax Load More.
134
 
135
  == Changelog ==
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  = 2.0.5 =
138
  * Updating db table structure
139
  * Adding upgrader_process_complete checker
4
  Tags: ajax, query, loop, paging, filter, jquery, shortcode builder, shortcode, search, tags, category
5
  Requires at least: 3.6
6
  Tested up to: 3.9.1
7
+ Stable tag: 2.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Ajax Load More is simple solution for lazy loading your WordPress posts and pages with Ajax.
12
 
13
  == Description ==
14
 
15
+ Ajax Load More is a simple yet powerful solution for lazy loading WordPress posts and pages with Ajax.
16
+ Build complex WordPress queries using our shortcode builder then add the shortcode to your pages via the content editor or directly into your template files.
17
+
18
 
19
 
20
+ = Features =
21
 
22
+ * **Shortcode Builder** - create your own Ajax Load More shortcode by adjusting the various WordPress query parameters (see Shortcode Parameters).
23
+ * **Query Parameters** - You can query WordPress for so many different content types it may be difficult to keep track! Query by Post type, Category, Tags, Custom Taxonomies, Search Term, Authors and more!!
24
+ * **Customizable Repeater Templates** - edit and extend the functionality of Ajax Load More by adjusting the repeater template (see screenshots).
25
+ * **Setting Panel** - Customize your version of Ajax Load More by updating various plugin settings (see screenshots).
26
+
27
+ Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for more information!
28
 
 
29
 
 
 
 
 
30
 
31
  = Shortcode Parameters =
32
 
33
+ Ajax Load More accepts a number of paramaters to pass to the WordPress query. These parameters are passed via shortcode - don't worry, creating your shortcode is simple with our Shortcode Builder.
34
 
35
+ * **repeater** - select from a list of customizable repeaters (Add-on available)
36
+ * **post_type** - comma seperated list of post types to query
37
+ * **category** - query by category slug
38
+ * **taxonomy** - query by custom taxonomy
39
+ * **taxonomy_terms** - comma seperated list of custom taxonomy terms(slug) to query
40
+ * **taxonomy_operator** - Operator to test (IN/NOT IN)
41
+ * **author** - query by author id
42
+ * **search** - query search term ('s')
43
+ * **order** - order posts ASC(ascending) or DESC(descending) order
44
+ * **orderby** - order posts by date, title, name, menu order, random, author, post ID or comment count
45
+ * **exclude** - comma separated list of post ID's to exclude from query.
46
+ * **offset** - offset the initial query (number).
47
+ * **posts_per_page** - number of posts to load with each request
48
+ * **scroll** - load more posts as the user scrolls the page (true/false)
49
+ * **max_pages** - maximum number of pages to load while scrolling (only if scroll == true)
50
+ * **pause** - do not load posts until user clicks load button (true/false)
51
+ * **transition** - select a loading transition from the drop menu (slide/fade)
52
+ * **button_label** - customize the Load More button label
53
+
54
 
55
 
56
  = Example Shortcode =
57
 
58
  [ajax_load_more post_type="post, portfolio" repeater="default" posts_per_page="5" transition="fade" button_label="Older Posts"]
59
+
60
+ = Demos =
61
+ * **[Default](http://connekthq.com/plugins/ajax-load-more/)** - Out of the box functionality and styling
62
+ * **[Fade Transition](http://connekthq.com/plugins/ajax-load-more/examples/fade-transition/)** - Elements fade in as posts are loaded
63
+ * **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
64
+
65
+ *The [Custom Repeater Add-On](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos*
66
+
67
+
68
+
69
+ = Add-ons =
70
+
71
+ The following Add-ons are available to increase the functionality of Ajax Load More.
72
+
73
+ **Custom Repeaters**
74
+
75
+ The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters) add-on will add five additional customizeable repeater templates and allow you to select unique templates for different content types throughout your theme.
76
+ [Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)
77
 
78
 
79
  = Tested Browsers =
80
 
81
  * Firefox (mac + pc)
82
+ * Chrome (mac + pc)
83
+ * Safari (mac)
84
  * IE8+
85
  * iPhone (Safari, Chrome)
86
  * Android (Native + Chrome)
87
  * BB10
88
 
89
 
 
90
 
91
+ = Website =
92
+ http://connekthq.com/ajax-load-more/
93
 
 
 
 
94
 
 
 
95
 
96
+ = Please Rate Ajax Load More! =
97
+
98
+ Your ratings make a big difference! If you like and use Ajax Load More, please consider taking the time to [rate my plugin](http://wordpress.org/support/view/plugin-reviews/ajax-load-more). Your ratings and reviews will help this plugin grow and provide the motivation needed to keep pushing it forward.
99
 
 
 
100
 
101
 
102
  == Frequently Asked Questions ==
112
 
113
  = Can I make modifications to the plugin code? =
114
 
115
+ Sure, but please be aware that if modifications are made it may affect future updates of the plugin.
116
+
117
+ = Can I modify the repeater template? =
118
+
119
+ Yes, visit the Repeater Template area in the WordPress admin.
120
 
121
+ = What are the steps to getting Ajax Load More to display on my website =
122
 
123
+ 1. Create your shortcode
124
+ 2. Add the shortcode to your page, by adding it through the content editor or placing it directly within one of your template files.
125
+ 3. Load a page with your shortcode in place and watch Ajax Load More fetch your posts.
126
 
127
  == Installation ==
128
 
162
 
163
  == Changelog ==
164
 
165
+ = 2.1.1 =
166
+ * Adding Order and Orderby query parameters, you can now set these values within the Shortcode Builder
167
+ * Updating core javascript code
168
+ * Fixed bug with taxonomy query selectors
169
+
170
+ = 2.1.0 =
171
+ * Adding custom taxonomy query - select from a list of custom taxonomies then select terms and operator
172
+ * Fixed path to repeater file in admin functions
173
+
174
+ = 2.0.15 =
175
+ * Fixed issue with loading of admin javascript and css on pages other than Ajax Load More
176
+
177
+ = 2.0.14 =
178
+ * Fixed issue with author query
179
+
180
+ = 2.0.13 =
181
+ * Fixed issue where loading button was not turning off when posts remaining were zero
182
+
183
+ = 2.0.12 =
184
+ * Adding add_filter('widget_text', 'do_shortcode');
185
+
186
+ = 2.0.11 =
187
+ * Removed 2 filters for widget_text which were casuing issues in sidebars
188
+
189
+ = 2.0.10 =
190
+ * Updating default repeater template to include the_permalink()
191
+
192
+ = 2.0.9 =
193
+ * Fixing issue with duplicate column names in database.
194
+
195
+ = 2.0.8 =
196
+ * removed upgrader_process_complete as it was unreliable. Replaced with admin_init to check whether plugin has been updated.
197
+
198
+ = 2.0.7 =
199
+ * Fixed jQuery conflict javascript error
200
+
201
+ = 2.0.6 =
202
+ * Fixing issue with scrolling of posts
203
+
204
  = 2.0.5 =
205
  * Updating db table structure
206
  * Adding upgrader_process_complete checker
admin/admin.php CHANGED
@@ -5,6 +5,27 @@
5
  add_action( 'admin_head', 'alm_admin_vars' );
6
  add_action( 'wp_ajax_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
7
  add_action( 'wp_ajax_nopriv_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
 
10
  /**
@@ -16,65 +37,66 @@ add_action( 'wp_ajax_nopriv_alm_save_repeater', 'alm_save_repeater' ); // Ajax S
16
  * @since 2.0.5
17
  */
18
 
19
- add_action('upgrader_process_complete', 'alm_core_update');
20
  function alm_core_update() {
21
  global $wpdb;
22
- $table_name = $wpdb->prefix . "alm";
23
-
24
- //If alm table exists
 
25
  if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) {
26
 
27
  // Updated 2.0.5
28
  // Check column 'name' exists in $wpdb - this is an upgrade checker.
29
- $row = $wpdb->get_results("SELECT COLUMN_NAME FROM $table_name.COLUMNS WHERE column_name = 'name'");
30
  if(empty($row)){
31
  $wpdb->query("ALTER TABLE $table_name ADD name TEXT NOT NULL");
32
  $wpdb->update($table_name , array('name' => 'default'), array('id' => 1));
33
  }
34
 
35
  // ********
36
- // @TO-DO
37
  // ********
38
- // Upgrade test, will remove in future versions
39
- $row2 = $wpdb->get_results("SELECT COLUMN_NAME FROM $table_name.COLUMNS WHERE column_name = 'test'");
40
- if(empty($row2)){
41
  $wpdb->query("ALTER TABLE $table_name ADD test TEXT NOT NULL");
42
  $wpdb->update($table_name , array('test' => 'test value'), array('id' => 1));
43
- }
44
-
45
 
46
- // Compare versions of repeaters, if template versions do not match, update the repeater with value from DB
47
  $version = $wpdb->get_var("SELECT pluginVersion FROM $table_name WHERE name = 'default'");
48
  if($version != ALM_VERSION){ // First, make sure versions do not match.
49
  //Write to repeater file
50
  $data = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE name = 'default'");
51
- $f = ALM_PATH. '/core/repeater/default.php'; // File
52
  $o = fopen($f, 'w+'); //Open file
53
  $w = fwrite($o, $data); //Save the file
54
  $r = fread($o, 100000); //Read it
55
  fclose($o); //now close it
56
  }
57
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
 
61
- /*
62
- * alm_admin_vars
63
- * Create admin variables and ajax nonce
64
- *
65
- * @since 2.0.0
66
- */
67
- function alm_admin_vars() { ?>
68
- <script type='text/javascript'>
69
- /* <![CDATA[ */
70
- var alm_admin_localize = <?php echo json_encode( array(
71
- 'ajax_admin_url' => admin_url( 'admin-ajax.php' ),
72
- 'alm_admin_nonce' => wp_create_nonce( 'alm_repeater_nonce' )
73
- )); ?>
74
- /* ]]> */
75
- </script>
76
- <?php }
77
-
78
 
79
  /**
80
  * alm_admin_menu
@@ -87,12 +109,53 @@ add_action( 'admin_menu', 'alm_admin_menu' );
87
  function alm_admin_menu() {
88
  $icon = 'dashicons-plus-alt';
89
  $icon = ALM_ADMIN_URL . "/img/alm-logo-16x16.png";
90
- add_menu_page( 'Ajax Load More', 'Ajax Load More', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page', $icon, 81 );
91
- add_submenu_page( 'ajax-load-more', 'Settings', 'Settings', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page');
92
- add_submenu_page( 'ajax-load-more', 'Repeater Templates', 'Repeater Templates', 'edit_theme_options', 'ajax-load-more-repeaters', 'alm_repeater_page');
93
- add_submenu_page( 'ajax-load-more', 'Shortcode Builder', 'Shortcode Builder', 'edit_theme_options', 'ajax-load-more-shortcode-builder', 'alm_shortcode_builder_page');
94
- add_submenu_page( 'ajax-load-more', 'Examples', 'Examples', 'edit_theme_options', 'ajax-load-more-examples', 'alm_example_page');
95
- add_submenu_page( 'ajax-load-more', 'Add-ons', 'Add-ons', 'edit_theme_options', 'ajax-load-more-add-ons', 'alm_add_ons_page');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
 
98
 
@@ -164,17 +227,12 @@ function alm_repeater_page(){ ?>
164
  fclose ($handle);
165
  ?>
166
  <h3 class="heading"><?php _e('Default Repeater Template', ALM_NAME); ?></h3>
167
- <div class="expand-wrap">
168
- <div class="section-title">
169
- <p><?php _e('Enter the HTML and PHP for the default template.', ALM_NAME); ?></p>
170
- </div>
171
  <div class="wrap repeater-wrap" data-name="default">
172
- <div class="textarea-wrap">
173
- <textarea rows="10" class="_alm_repeater"><?php echo $contents; ?></textarea>
174
- </div>
175
- <input type="submit" value="Save Template" class="button button-primary save-repeater">
176
  <div class="saved-response">&nbsp;</div>
177
- <!-- <div class="restore-default"><a href="javascript:void(0);"><?php _e('Restore Default', ALM_NAME); ?></a></div> -->
178
  </div>
179
  </div>
180
  <?php
@@ -192,9 +250,8 @@ function alm_repeater_page(){ ?>
192
  do_action('alm_custom_repeaters');
193
  ?>
194
  <script>
195
- $(document).ready(function() {
196
- "use strict";
197
- $(document).ready(function() {
198
  var _alm_admin = {};
199
 
200
  /*
@@ -247,8 +304,7 @@ function alm_repeater_page(){ ?>
247
  _alm_admin.saveRepeater(btn);
248
  });
249
  });
250
- });
251
- });
252
  </script>
253
  </section>
254
  <!-- End Repeaters -->
@@ -274,7 +330,7 @@ function alm_repeater_page(){ ?>
274
  <div class="item">
275
  <p><strong><?php _e('Tips and Tricks', ALM_NAME); ?></strong></p>
276
  <ul>
277
- <li><?php _e('Always open and close your templates with an HTML element. In some rare cases data may not be displayed.<br/>e.g. <code>&lt;li> &lt;/li></code> or <code>&lt;div> &lt;/div></code>', ALM_NAME); ?><br/> </li>
278
  </ul>
279
  </div>
280
  </div>
@@ -377,6 +433,43 @@ function alm_shortcode_builder_page(){ ?>
377
  }
378
 
379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  /*
381
  * alm_example_page
382
  * Examples Page
@@ -396,7 +489,7 @@ function alm_example_page(){ ?>
396
  <div class="row gist">
397
  <h3 class="heading"><?php _e('Author.php', ALM_NAME); ?></h3>
398
  <div class="expand-wrap">
399
- <p><?php _e('Example shortcode for use on author archive pages.', ALM_NAME); ?></p>
400
  <div class="inner">
401
  <script src="https://gist.github.com/dcooney/4d07ff95f7274f38fd3a.js"></script>
402
  </div>
@@ -405,7 +498,7 @@ function alm_example_page(){ ?>
405
  <div class="row gist">
406
  <h3 class="heading"><?php _e('Category.php', ALM_NAME); ?></h3>
407
  <div class="expand-wrap">
408
- <p><?php _e('Example shortcode for use on category archive pages.', ALM_NAME); ?></p>
409
  <div class="inner">
410
  <script src="https://gist.github.com/dcooney/ae4caec3f9061dd47627.js"></script>
411
  </div>
@@ -414,7 +507,7 @@ function alm_example_page(){ ?>
414
  <div class="row gist">
415
  <h3 class="heading"><?php _e('Excluding Posts', ALM_NAME); ?></h3>
416
  <div class="expand-wrap">
417
- <p><?php _e('Example shortcode for excluding an array of posts.', ALM_NAME); ?></p>
418
  <script src="https://gist.github.com/dcooney/9b037efbd166b4dba5ae.js"></script>
419
  </div>
420
  </div>
@@ -422,7 +515,7 @@ function alm_example_page(){ ?>
422
  <div class="row gist">
423
  <h3 class="heading"><?php _e('Tag.php', ALM_NAME); ?></h3>
424
  <div class="expand-wrap">
425
- <p><?php _e('Example shortcode for use on tag archive pages.', ALM_NAME); ?></p>
426
  <div class="inner">
427
  <script src="https://gist.github.com/dcooney/fc4276bebbdd05af64d1.js"></script>
428
  </div>
@@ -473,9 +566,9 @@ function alm_add_ons_page(){ ?>
473
  <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/repeater-add-ons.jpg">
474
  </div>
475
  <div class="wrap">
476
- <p class="addon-intro"><?php _e('Unlock additional repeaters and keep your site looking fresh!', ALM_NAME); ?></p>
477
  <p><?php _e('The Custom Repeaters add-on will add <strong>five</strong> additional <a href="?page=ajax-load-more-repeaters">repeaters</a> and allow you to select unique repeaters for different content types throughout your theme.</p>
478
- <p>It\'s easy! Just build each <a href="?page=ajax-load-more-repeaters">repeater</a> and then choose from the list of repeaters while building your <a href="?page=ajax-load-more-shortcode-builder">shortcode</a>.</p><p><strong>Read/Write Access is required!</strong></p>', ALM_NAME); ?>
479
  </div>
480
  </div>
481
  </div>
@@ -483,7 +576,7 @@ function alm_add_ons_page(){ ?>
483
  if (has_action('alm_repeater_installed')){
484
  echo '<a class="btn installed" href="#"><i class="fa fa-check-square"></i> Installed</a> ';
485
  }else{
486
- echo '<a class="btn" href="http://connekthq.com/ajax-load-more/custom-repeaters" target="_blank"><i class="fa fa-download"></i> Purchase &amp; Install</a>';
487
  }
488
  ?>
489
  </section>
@@ -503,27 +596,6 @@ function alm_add_ons_page(){ ?>
503
  <?php
504
  }
505
 
506
- /*
507
- * adminHeader
508
- * Admin CSS and JS
509
- *
510
- * @since 2.0.0
511
- */
512
-
513
- add_action('admin_head', 'alm_adminHeader');
514
- add_action('admin_footer', 'alm_adminFooter');
515
- function alm_adminHeader() {
516
- $url = plugins_url( 'css/admin.css', __FILE__ );
517
- echo '<link rel="stylesheet" type="text/css" href="' . $url . '" />';
518
- echo '<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">';
519
- echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>';
520
- }
521
- function alm_adminFooter() {
522
- echo '<script type="text/javascript" src="'.plugins_url( 'js/libs/select2.min.js', __FILE__ ).'"></script>';
523
- echo '<script type="text/javascript" src="'.plugins_url( 'js/shortcode-builder.js', __FILE__ ).'"></script>';
524
- }
525
-
526
-
527
 
528
  /*
529
  * admin_init
@@ -622,7 +694,7 @@ function alm_disable_css_callback(){
622
 
623
  echo '<input type="hidden" name="alm_settings[_alm_disable_css]" value="0" />
624
  <label><input type="checkbox" name="alm_settings[_alm_disable_css]" value="1"'. (($options['_alm_disable_css']) ? ' checked="checked"' : '') .' /> I want to use my own CSS styles</label>';
625
- echo '<p class="desc"><i class="fa fa-file-text-o"></i> &nbsp;<a href="'.ALM_URL.'/css/ajax-load-more.css" target="blank">View Ajax Load More CSS</a></p>';
626
  }
627
 
628
 
5
  add_action( 'admin_head', 'alm_admin_vars' );
6
  add_action( 'wp_ajax_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
7
  add_action( 'wp_ajax_nopriv_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
8
+ add_action( 'wp_ajax_alm_get_tax_terms', 'alm_get_tax_terms' ); // Ajax Get Taxonomy Terms
9
+ add_action( 'wp_ajax_nopriv_alm_get_tax_terms', 'alm_get_tax_terms' ); // Ajax Get Taxonomy Terms
10
+
11
+
12
+ /*
13
+ * alm_admin_vars
14
+ * Create admin variables and ajax nonce
15
+ *
16
+ * @since 2.0.0
17
+ */
18
+ function alm_admin_vars() { ?>
19
+ <script type='text/javascript'>
20
+ /* <![CDATA[ */
21
+ var alm_admin_localize = <?php echo json_encode( array(
22
+ 'ajax_admin_url' => admin_url( 'admin-ajax.php' ),
23
+ 'alm_admin_nonce' => wp_create_nonce( 'alm_repeater_nonce' )
24
+ )); ?>
25
+ /* ]]> */
26
+ </script>
27
+ <?php }
28
+
29
 
30
 
31
  /**
37
  * @since 2.0.5
38
  */
39
 
40
+ add_action('admin_init', 'alm_core_update');
41
  function alm_core_update() {
42
  global $wpdb;
43
+ $table_name = $wpdb->prefix . "alm";
44
+ // **********************************************
45
+ // If table exists
46
+ // **********************************************
47
  if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) {
48
 
49
  // Updated 2.0.5
50
  // Check column 'name' exists in $wpdb - this is an upgrade checker.
51
+ $row = $wpdb->get_col("Show columns from $table_name like 'name'");
52
  if(empty($row)){
53
  $wpdb->query("ALTER TABLE $table_name ADD name TEXT NOT NULL");
54
  $wpdb->update($table_name , array('name' => 'default'), array('id' => 1));
55
  }
56
 
57
  // ********
58
+ // @TO-DO - Upgrade test, will remove in future versions
59
  // ********
60
+ $test = $wpdb->get_col("Show columns from $table_name like 'test'");
61
+ if(empty($test)){
 
62
  $wpdb->query("ALTER TABLE $table_name ADD test TEXT NOT NULL");
63
  $wpdb->update($table_name , array('test' => 'test value'), array('id' => 1));
64
+ }
 
65
 
66
+ // Compare versions of repeaters, if template versions do not match, update the repeater with value from DB
67
  $version = $wpdb->get_var("SELECT pluginVersion FROM $table_name WHERE name = 'default'");
68
  if($version != ALM_VERSION){ // First, make sure versions do not match.
69
  //Write to repeater file
70
  $data = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE name = 'default'");
71
+ $f = ALM_PATH. 'core/repeater/default.php'; // File
72
  $o = fopen($f, 'w+'); //Open file
73
  $w = fwrite($o, $data); //Save the file
74
  $r = fread($o, 100000); //Read it
75
  fclose($o); //now close it
76
  }
77
  }
78
+
79
+ // **********************************************
80
+ // If table DOES NOT exist, create it.
81
+ // **********************************************
82
+ if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
83
+ $createRepeater = '<li><?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(100,100));}?><h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3><p class="entry-meta"><?php the_time("F d, Y"); ?></p><?php the_excerpt(); ?></li>';
84
+ $sql = "CREATE TABLE $table_name (
85
+ id mediumint(9) NOT NULL AUTO_INCREMENT,
86
+ name text NOT NULL,
87
+ repeaterDefault longtext NOT NULL,
88
+ pluginVersion text NOT NULL,
89
+ UNIQUE KEY id (id)
90
+ );";
91
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
92
+ dbDelta( $sql );
93
+
94
+ //Insert default data in newly created table
95
+ $wpdb->insert($table_name , array('name' => 'default', 'repeaterDefault' => $createRepeater, 'pluginVersion' => ALM_VERSION));
96
+ }
97
  }
98
 
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  /**
102
  * alm_admin_menu
109
  function alm_admin_menu() {
110
  $icon = 'dashicons-plus-alt';
111
  $icon = ALM_ADMIN_URL . "/img/alm-logo-16x16.png";
112
+ $alm_page = add_menu_page( 'Ajax Load More', 'Ajax Load More', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page', $icon, 81 );
113
+ $alm_settings_page = add_submenu_page( 'ajax-load-more', 'Settings', 'Settings', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page');
114
+ $alm_template_page = add_submenu_page( 'ajax-load-more', 'Repeater Templates', 'Repeater Templates', 'edit_theme_options', 'ajax-load-more-repeaters', 'alm_repeater_page');
115
+ $alm_shortcode_page = add_submenu_page( 'ajax-load-more', 'Shortcode Builder', 'Shortcode Builder', 'edit_theme_options', 'ajax-load-more-shortcode-builder', 'alm_shortcode_builder_page');
116
+ $alm_examples_page = add_submenu_page( 'ajax-load-more', 'Examples', 'Examples', 'edit_theme_options', 'ajax-load-more-examples', 'alm_example_page');
117
+ $alm_addons_page = add_submenu_page( 'ajax-load-more', 'Add-ons', 'Add-ons', 'edit_theme_options', 'ajax-load-more-add-ons', 'alm_add_ons_page');
118
+
119
+ //Add our admin scripts
120
+ add_action( 'load-' . $alm_settings_page, 'alm_load_admin_js' );
121
+ add_action( 'load-' . $alm_template_page, 'alm_load_admin_js' );
122
+ add_action( 'load-' . $alm_shortcode_page, 'alm_load_admin_js' );
123
+ add_action( 'load-' . $alm_examples_page, 'alm_load_admin_js' );
124
+ add_action( 'load-' . $alm_addons_page, 'alm_load_admin_js' );
125
+
126
+ }
127
+
128
+
129
+
130
+ /**
131
+ * alm_load_admin_js
132
+ * Load Admin JS
133
+ *
134
+ * @since 2.0.15
135
+ */
136
+
137
+ function alm_load_admin_js(){
138
+ add_action( 'admin_enqueue_scripts', 'alm_enqueue_admin_scripts' );
139
+ }
140
+
141
+
142
+
143
+ /**
144
+ * alm_enqueue_admin_scripts
145
+ * Enqueue Admin JS
146
+ *
147
+ * @since 2.0.15
148
+ */
149
+
150
+ function alm_enqueue_admin_scripts(){
151
+
152
+ //Load CSS
153
+ wp_enqueue_style( 'admin-css', ALM_ADMIN_URL. 'css/admin.css');
154
+ wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
155
+
156
+ //Load JS
157
+ wp_enqueue_script( 'select2', ALM_ADMIN_URL. 'js/libs/select2.min.js', array( 'jquery' ));
158
+ wp_enqueue_script( 'shortcode-builder', ALM_ADMIN_URL. 'js/shortcode-builder.js', array( 'jquery' ));
159
  }
160
 
161
 
227
  fclose ($handle);
228
  ?>
229
  <h3 class="heading"><?php _e('Default Repeater Template', ALM_NAME); ?></h3>
230
+ <div class="expand-wrap">
 
 
 
231
  <div class="wrap repeater-wrap" data-name="default">
232
+ <label class="template-title" for="default_repeater"><?php _e('Enter the HTML and PHP for the default template', ALM_NAME); ?></label>
233
+ <textarea rows="10" id="default_repeater" class="_alm_repeater" contenteditable><?php echo $contents; ?></textarea>
234
+ <input type="submit" value="<?php _e('Save Template', ALM_NAME); ?>" class="button button-primary save-repeater">
 
235
  <div class="saved-response">&nbsp;</div>
 
236
  </div>
237
  </div>
238
  <?php
250
  do_action('alm_custom_repeaters');
251
  ?>
252
  <script>
253
+ jQuery(document).ready(function($) {
254
+ "use strict";
 
255
  var _alm_admin = {};
256
 
257
  /*
304
  _alm_admin.saveRepeater(btn);
305
  });
306
  });
307
+ });
 
308
  </script>
309
  </section>
310
  <!-- End Repeaters -->
330
  <div class="item">
331
  <p><strong><?php _e('Tips and Tricks', ALM_NAME); ?></strong></p>
332
  <ul>
333
+ <li><?php _e('Always open and close your templates with an HTML element. In some rare cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code>&lt;li> &lt;/li></code> or <code>&lt;div> &lt;/div></code>', ALM_NAME); ?><br/> </li>
334
  </ul>
335
  </div>
336
  </div>
433
  }
434
 
435
 
436
+ /*
437
+ * alm_get_tax_terms
438
+ * Get taxonomy terms for shortcode builder
439
+ *
440
+ * @since 2.1.0
441
+ */
442
+
443
+ function alm_get_tax_terms(){
444
+ $nonce = $_GET["nonce"];
445
+ // Check our nonce, if they don't match then bounce!
446
+ if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
447
+ die('Get Bounced!');
448
+
449
+ $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
450
+ $tax_args = array(
451
+ 'orderby' => 'name',
452
+ 'order' => 'ASC',
453
+ 'hide_empty' => false
454
+ );
455
+ $terms = get_terms($taxonomy, $tax_args);
456
+ $returnVal = '';
457
+ if ( !empty( $terms ) && !is_wp_error( $terms ) ){
458
+ $returnVal .= '<ul>';
459
+ foreach ( $terms as $term ) {
460
+ //print_r($term);
461
+ $returnVal .='<li><input type="checkbox" name="tax-term-'.$term->slug.'" id="tax-term-'.$term->slug.'" data-type="'.$term->slug.'"><label for="tax-term-'.$term->slug.'">'.$term->name.'</label></li>';
462
+ }
463
+ $returnVal .= '</ul>';
464
+ echo $returnVal;
465
+ die();
466
+ }else{
467
+ echo "<p class='warning'>No terms exist within this taxonomy</p>";
468
+ die();
469
+ }
470
+ }
471
+
472
+
473
  /*
474
  * alm_example_page
475
  * Examples Page
489
  <div class="row gist">
490
  <h3 class="heading"><?php _e('Author.php', ALM_NAME); ?></h3>
491
  <div class="expand-wrap">
492
+ <p><?php _e('Shortcode for use on author archive pages.', ALM_NAME); ?></p>
493
  <div class="inner">
494
  <script src="https://gist.github.com/dcooney/4d07ff95f7274f38fd3a.js"></script>
495
  </div>
498
  <div class="row gist">
499
  <h3 class="heading"><?php _e('Category.php', ALM_NAME); ?></h3>
500
  <div class="expand-wrap">
501
+ <p><?php _e('Shortcode for use on category archive pages.', ALM_NAME); ?></p>
502
  <div class="inner">
503
  <script src="https://gist.github.com/dcooney/ae4caec3f9061dd47627.js"></script>
504
  </div>
507
  <div class="row gist">
508
  <h3 class="heading"><?php _e('Excluding Posts', ALM_NAME); ?></h3>
509
  <div class="expand-wrap">
510
+ <p><?php _e('Shortcode for excluding an array of posts.', ALM_NAME); ?></p>
511
  <script src="https://gist.github.com/dcooney/9b037efbd166b4dba5ae.js"></script>
512
  </div>
513
  </div>
515
  <div class="row gist">
516
  <h3 class="heading"><?php _e('Tag.php', ALM_NAME); ?></h3>
517
  <div class="expand-wrap">
518
+ <p><?php _e('Shortcode for use on tag archive pages.', ALM_NAME); ?></p>
519
  <div class="inner">
520
  <script src="https://gist.github.com/dcooney/fc4276bebbdd05af64d1.js"></script>
521
  </div>
566
  <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/repeater-add-ons.jpg">
567
  </div>
568
  <div class="wrap">
569
+ <p class="addon-intro"><?php _e('Unlock additional repeater templates and keep your site looking and feeling fresh!', ALM_NAME); ?></p>
570
  <p><?php _e('The Custom Repeaters add-on will add <strong>five</strong> additional <a href="?page=ajax-load-more-repeaters">repeaters</a> and allow you to select unique repeaters for different content types throughout your theme.</p>
571
+ <p>It\'s easy, seriously! Simply build each <a href="?page=ajax-load-more-repeaters">repeater</a> just the way you want them, then select a template from the list of available templates while building your <a href="?page=ajax-load-more-shortcode-builder">shortcode</a>.</p><p><strong>Read/Write Access is required!</strong></p>', ALM_NAME); ?>
572
  </div>
573
  </div>
574
  </div>
576
  if (has_action('alm_repeater_installed')){
577
  echo '<a class="btn installed" href="#"><i class="fa fa-check-square"></i> Installed</a> ';
578
  }else{
579
+ echo '<a class="btn" href="http://connekthq.com/plugins/ajax-load-more/custom-repeaters/" target="_blank"><i class="fa fa-download"></i> Purchase &amp; Install</a>';
580
  }
581
  ?>
582
  </section>
596
  <?php
597
  }
598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
 
600
  /*
601
  * admin_init
694
 
695
  echo '<input type="hidden" name="alm_settings[_alm_disable_css]" value="0" />
696
  <label><input type="checkbox" name="alm_settings[_alm_disable_css]" value="1"'. (($options['_alm_disable_css']) ? ' checked="checked"' : '') .' /> I want to use my own CSS styles</label>';
697
+ echo '<p class="desc"><i class="fa fa-file-text-o"></i> &nbsp;<a href="'.ALM_URL.'/core/css/ajax-load-more.css" target="blank">View Ajax Load More CSS</a></p>';
698
  }
699
 
700
 
admin/css/admin.css CHANGED
@@ -107,6 +107,67 @@
107
  .ajax-load-more h3.heading.open:after{
108
  content:'\f055';
109
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
 
112
  .ajax-load-more ul{
@@ -118,12 +179,44 @@
118
  .forceColors li{
119
  padding: 0 5% 0 0;
120
  margin: 0 0 5px;
121
- width: 50%;
122
  clear: both;
123
  display: inline-block;
124
  overflow: visible;
125
  }
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  .ajax-load-more label,
129
  .ajax-load-more input,
@@ -142,26 +235,32 @@
142
  }
143
 
144
 
145
- .row.checkboxes{}
146
- .row.checkboxes input,
147
- .row.checkboxes label{
 
 
148
  float: left;
149
  width: auto;
150
  margin-right: 10px;
151
  padding: 0;
152
  clear: none;
153
  }
 
 
 
154
  .ajax-load-more input[type=text]{
155
  padding: 10px;
156
  border: 1px solid #ccc;
157
  width: 50%;
158
  }
159
- .ajax-load-more input[type=text]:focus{
 
160
  border-color: #999;
161
  box-shadow: 0 0 3px #ccc;
162
  }
163
 
164
- .row.checkboxes label{
165
  margin-right: 5px;
166
  }
167
 
@@ -184,7 +283,7 @@
184
  .admin.ajax-load-more .row{
185
  border-color: #efefef;
186
  }
187
- .admin.ajax-load-more .row:first-child{
188
  margin: 0;
189
  padding-top: 0;
190
  border-top: none;
@@ -230,6 +329,16 @@
230
  .ajax-load-more .repeaters .section-title p{
231
  padding-left: 0 !important;
232
  }
 
 
 
 
 
 
 
 
 
 
233
 
234
 
235
 
@@ -277,6 +386,11 @@
277
  .ajax-load-more .row .wrap .inner{
278
  padding:0 0 20px;
279
  }
 
 
 
 
 
280
 
281
  .output-wrap .copy{
282
  background: #fff;
@@ -331,7 +445,7 @@
331
 
332
  .admin.ajax-load-more #shortcode_output{
333
  border: none;
334
- padding: 24px;
335
  }
336
 
337
 
@@ -521,7 +635,8 @@
521
  text-decoration: none;
522
  }
523
 
524
- .saved-response{
 
525
  font-size: 12px;
526
  padding: 8px 0;
527
  color:#999;
@@ -532,7 +647,11 @@
532
  top: 12px;
533
  left: 15px;
534
  }
535
- .saved-response.loading{
 
 
 
 
536
  background: url(../img/loader.gif) no-repeat left center;
537
  padding-left: 24px;
538
  }
@@ -599,11 +718,10 @@ table.highlight{
599
  margin: 15px 0 0;
600
  clear: none;
601
  }
602
- .default-repeater textarea{
603
- width: 100%;
604
- }
605
- .repeater-wrap textarea{
606
  background: #efefef;
 
607
  }
608
 
609
 
@@ -835,6 +953,17 @@ a.btn{
835
  }
836
  }
837
 
 
 
 
 
 
 
 
 
 
 
 
838
 
839
 
840
 
@@ -853,6 +982,10 @@ a.btn{
853
  vertical-align: middle;
854
  min-width: 50%;
855
  }
 
 
 
 
856
  .select2-container a.select2-choice {
857
  display: block;
858
  height: 40px;
107
  .ajax-load-more h3.heading.open:after{
108
  content:'\f055';
109
  }
110
+
111
+ /* Expand/Collapse all rows */
112
+ .ajax-load-more .toggle-all{
113
+ position: absolute;
114
+ top:-12px;
115
+ right: 20px;
116
+ width: auto;
117
+ display: inline-block;
118
+ font-size: 11px;
119
+ text-transform: uppercase;
120
+ border-radius: 3px;
121
+ padding: 0 12px 0 10px;
122
+ height: 25px;
123
+ line-height: 24px;
124
+ background: #fff;
125
+ border:1px solid #ccc;
126
+ color: #777;
127
+ cursor: pointer;
128
+ z-index: 2;
129
+ }
130
+ #alm-container.ajax-load-more .toggle-all{
131
+ display: none;
132
+ }
133
+ .ajax-load-more .toggle-all:hover{
134
+ color: #ca5252;
135
+ }
136
+ .ajax-load-more .toggle-all .inner-wrap{
137
+ position: relative;
138
+ padding-left: 16px;
139
+ line-height: 24px;
140
+ }
141
+
142
+ .ajax-load-more .toggle-all .expand{
143
+ display: none;
144
+ }
145
+ .ajax-load-more .toggle-all .collapse{
146
+ display: inline-block;
147
+ }
148
+ .ajax-load-more .toggle-all em{
149
+ font-style: normal;
150
+ }
151
+
152
+ .ajax-load-more .toggle-all.closed .expand{
153
+ display: inline-block;
154
+ }
155
+ .ajax-load-more .toggle-all.closed .collapse{
156
+ display: none;
157
+ }
158
+
159
+ .ajax-load-more .toggle-all .inner-wrap:before{
160
+ font-family: 'FontAwesome';
161
+ content: '\f068';
162
+ font-size: 10px;
163
+ position: absolute;
164
+ left: 0;
165
+ top: -4px;
166
+ }
167
+ .ajax-load-more .toggle-all.closed .inner-wrap:before{
168
+ content:'\f067';
169
+ }
170
+
171
 
172
 
173
  .ajax-load-more ul{
179
  .forceColors li{
180
  padding: 0 5% 0 0;
181
  margin: 0 0 5px;
182
+ width: 49.75%;
183
  clear: both;
184
  display: inline-block;
185
  overflow: visible;
186
  }
187
 
188
+ .ajax-load-more label.full{
189
+ display: block;
190
+ clear: both;
191
+ width: 100%;
192
+ color: #444;
193
+ font-weight: 600;
194
+ padding: 0 0 10px;
195
+ cursor: default;
196
+ font-size: 12px;
197
+ text-transform: uppercase;
198
+ }
199
+ .ajax-load-more .border-top{
200
+ display: block;
201
+ border-top: 1px solid #efefef;
202
+ width: 100%;
203
+ clear: both;
204
+ margin: 0 0 20px;
205
+ padding: 20px 0 0 !important;
206
+ overflow:hidden;
207
+ }
208
+ .ajax-load-more #taxonomy-extended{
209
+ display: none;
210
+ overflow: hidden;
211
+ }
212
+ .ajax-load-more p.warning{
213
+ color: #d24646;
214
+ font-size: 13px;
215
+ border-left: 3px solid #d24646;
216
+ margin: 0;
217
+ padding: 0 0 0 10px;
218
+ }
219
+
220
 
221
  .ajax-load-more label,
222
  .ajax-load-more input,
235
  }
236
 
237
 
238
+ .checkboxes{}
239
+ .checkboxes input,
240
+ .checkboxes label,
241
+ .radio input,
242
+ .radio label{
243
  float: left;
244
  width: auto;
245
  margin-right: 10px;
246
  padding: 0;
247
  clear: none;
248
  }
249
+ .radio input{
250
+ margin-left: 3px;
251
+ }
252
  .ajax-load-more input[type=text]{
253
  padding: 10px;
254
  border: 1px solid #ccc;
255
  width: 50%;
256
  }
257
+ .ajax-load-more input[type=text]:focus,
258
+ .ajax-load-more textarea:focus{
259
  border-color: #999;
260
  box-shadow: 0 0 3px #ccc;
261
  }
262
 
263
+ .checkboxes label{
264
  margin-right: 5px;
265
  }
266
 
283
  .admin.ajax-load-more .row{
284
  border-color: #efefef;
285
  }
286
+ .admin.ajax-load-more .row:first-of-type{
287
  margin: 0;
288
  padding-top: 0;
289
  border-top: none;
329
  .ajax-load-more .repeaters .section-title p{
330
  padding-left: 0 !important;
331
  }
332
+ .ajax-load-more label.template-title{
333
+ padding: 10px 0 5px;
334
+ margin: 0;
335
+ font-size: 0.9em;
336
+ }
337
+
338
+ .ajax-load-more label input._alm_repeater_alias{
339
+ height: auto;
340
+ line-height: normal !important;
341
+ }
342
 
343
 
344
 
386
  .ajax-load-more .row .wrap .inner{
387
  padding:0 0 20px;
388
  }
389
+ .ajax-load-more .row .wrap .inner.half{
390
+ padding:0 0 20px;
391
+ width: 49.5%;
392
+ display: inline-block;
393
+ }
394
 
395
  .output-wrap .copy{
396
  background: #fff;
445
 
446
  .admin.ajax-load-more #shortcode_output{
447
  border: none;
448
+ padding: 12px 12px 24px;
449
  }
450
 
451
 
635
  text-decoration: none;
636
  }
637
 
638
+ .saved-response,
639
+ p.loading{
640
  font-size: 12px;
641
  padding: 8px 0;
642
  color:#999;
647
  top: 12px;
648
  left: 15px;
649
  }
650
+ p.loading{
651
+ position: static;
652
+ }
653
+ .saved-response.loading,
654
+ p.loading{
655
  background: url(../img/loader.gif) no-repeat left center;
656
  padding-left: 24px;
657
  }
718
  margin: 15px 0 0;
719
  clear: none;
720
  }
721
+ .repeater-wrap textarea,
722
+ .repeater-wrap input[type=text]{
 
 
723
  background: #efefef;
724
+ width: 100%;
725
  }
726
 
727
 
953
  }
954
  }
955
 
956
+ @media screen and (max-width: 480px){
957
+ .ajax-load-more .section-title,
958
+ .ajax-load-more .row .wrap{
959
+ clear: both;
960
+ width: 100%;
961
+ display: block;
962
+ float: none;
963
+ padding: 0 0 10px;
964
+ }
965
+
966
+ }
967
 
968
 
969
 
982
  vertical-align: middle;
983
  min-width: 50%;
984
  }
985
+ .inner.half .select2-container{
986
+ min-width: 90%;
987
+ width: 90%;
988
+ }
989
  .select2-container a.select2-choice {
990
  display: block;
991
  height: 40px;
admin/editor-build.php CHANGED
@@ -1,7 +1,7 @@
1
  <!DOCTYPE html>
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
- <title>Ajax Load More Shortcode Builder</title>
5
  <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
6
  <link rel="stylesheet" src="<?php echo includes_url($path); ?>js/tinymce/themes/advanced/skins/wp_theme/dialog.css"></link>
7
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/admin.css" />
@@ -29,6 +29,7 @@ var AjaxLoadMoreModal = {
29
  };
30
  tinyMCEPopup.onInit.add(AjaxLoadMoreModal.init, AjaxLoadMoreModal);
31
  </script>
 
32
  </head>
33
  <body>
34
  <div id="alm-container" class="ajax-load-more">
1
  <!DOCTYPE html>
2
  <html xmlns="http://www.w3.org/1999/xhtml">
3
  <head>
4
+ <title>Ajax Load More: Shortcode Builder</title>
5
  <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
6
  <link rel="stylesheet" src="<?php echo includes_url($path); ?>js/tinymce/themes/advanced/skins/wp_theme/dialog.css"></link>
7
  <link rel="stylesheet" href="<?php echo ALM_ADMIN_URL; ?>css/admin.css" />
29
  };
30
  tinyMCEPopup.onInit.add(AjaxLoadMoreModal.init, AjaxLoadMoreModal);
31
  </script>
32
+ <?php $is_modal = true; ?>
33
  </head>
34
  <body>
35
  <div id="alm-container" class="ajax-load-more">
admin/editor.php CHANGED
@@ -7,7 +7,6 @@ function alm_editor_init() {
7
  wp_enqueue_script( 'jquery' );
8
  }
9
 
10
-
11
  add_action('wp_ajax_fscb', 'alm_ajax_tinymce' );
12
  function alm_ajax_tinymce(){
13
  // check for rights
7
  wp_enqueue_script( 'jquery' );
8
  }
9
 
 
10
  add_action('wp_ajax_fscb', 'alm_ajax_tinymce' );
11
  function alm_ajax_tinymce(){
12
  // check for rights
admin/includes/cta/about.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="cta padding-bottom">
2
  <h3>About the plugin</h3>
3
- <p>Ajax Load More is a simple yet very powerful solution for loading WordPress posts and page via AJAX requests.</p>
4
  <br/>
5
  <p><strong>View my other projects:</strong></p>
6
  <ul>
1
  <div class="cta padding-bottom">
2
  <h3>About the plugin</h3>
3
+ <p>Ajax Load More is a simple yet very powerful solution for lazy loading WordPress posts and pages via AJAX requests.</p>
4
  <br/>
5
  <p><strong>View my other projects:</strong></p>
6
  <ul>
admin/includes/cta/extend.php CHANGED
@@ -1 +1 @@
1
- <div class="clear"></div><div class="call-out"><?php _e('Unlock additional repeaters with the <a href="?page=ajax-load-more-add-ons" target="_parent">Custom Repeaters add-on</a>', ALM_NAME); ?> <a class="btn" href="http://connekthq.com/ajax-load-more/custom-repeaters" target="_blank"><?php _e('More Info', ALM_NAME); ?></a></div>
1
+ <div class="clear"></div><div class="call-out"><?php _e('Unlock additional repeaters with the <a href="?page=ajax-load-more-add-ons" target="_parent">Custom Repeaters add-on</a>', ALM_NAME); ?> <a class="btn" href="http://connekthq.com/plugins/ajax-load-more/custom-repeaters" target="_blank"><?php _e('More Info', ALM_NAME); ?></a></div>
admin/includes/cta/resources.php CHANGED
@@ -1,9 +1,10 @@
1
  <div class="cta padding-bottom">
2
  <h3><?php _e('Help/Resources', ALM_NAME); ?></h3>
3
  <ul>
4
- <li><a target="_blank" href="http://cnkt.ca/ajax-load-more/">Ajax Load More Demo</a></li>
5
- <li><a target="_blank" href="https://github.com/dcooney/wordpress-ajax-load-more/blob/master/README.md">Readme</a></li>
6
- <li><a target="_blank" href="https://github.com/dcooney/wordpress-ajax-load-more/issues?state=open">Report Issue</a></li>
 
7
  </ul>
8
- <?php _e('<a href="https://github.com/dcooney/wordpress-ajax-load-more" target="blank" class="visit"><i class="fa fa-github"></i> Latest build on Github</a>', ALM_NAME); ?>
9
  </div>
1
  <div class="cta padding-bottom">
2
  <h3><?php _e('Help/Resources', ALM_NAME); ?></h3>
3
  <ul>
4
+ <li><a target="_blank" href="http://connekthq.com/plugins/ajax-load-more/">Ajax Load More Demo Site</a></li>
5
+ <li><a target="_blank" href="http://plugins.svn.wordpress.org/ajax-load-more/trunk/README.txt">Readme</a></li>
6
+ <li><a target="_blank" href="http://wordpress.org/support/plugin/ajax-load-more">Support</a></li>
7
+ <li><a target="_blank" href="http://connekthq.com/plugins/ajax-load-more/custom-repeaters/">Custom Repeaters Add-on</a></li>
8
  </ul>
9
+ <?php _e('<a href="https://github.com/dcooney/wordpress-ajax-load-more" target="blank" class="visit"><i class="fa fa-github"></i> Latest development build on Github</a>', ALM_NAME); ?>
10
  </div>
admin/includes/shortcode-builder.php CHANGED
@@ -1,4 +1,4 @@
1
-
2
 
3
  <?php
4
  // List available repeaters
@@ -6,7 +6,7 @@
6
  echo '<h3 class="heading">'.__('Repeater', ALM_NAME). '</h3>';
7
  echo '<div class="expand-wrap">';
8
  echo '<div class="section-title">';
9
- echo '<p>'.__('Select a <a href="?page=ajax-load-more-repeaters">repeater</a> from drop menu.', ALM_NAME). '</p>';
10
  echo '</div>';
11
  echo '<div class="wrap"><div class="inner">';
12
  echo '<select name="repeater-select" id="repeater-select">';
@@ -45,7 +45,7 @@
45
  echo '</div>';
46
  echo '</div>';
47
  }
48
-
49
  // List Categories
50
  $cats = get_categories();
51
  if($cats){
@@ -53,7 +53,7 @@
53
  echo '<h3 class="heading">' . __('Category', ALM_NAME) . '</h3>';
54
  echo '<div class="expand-wrap">';
55
  echo '<div class="section-title">';
56
- echo '<p>' . __('Select a Category to query(by slug) from the drop menu.', ALM_NAME) . '</p>';
57
  echo '</div>';
58
  echo '<div class="wrap"><div class="inner"><select name="category-select" id="category-select">';
59
  echo '<option value="" selected="selected">-- ' . __('Select Category', ALM_NAME) . ' --</option>';
@@ -72,7 +72,7 @@
72
  echo '<h3 class="heading">' . __('Tag', ALM_NAME) . '</h3>';
73
  echo '<div class="expand-wrap">';
74
  echo '<div class="section-title">';
75
- echo '<p>' . __('Select a Tag to query(by slug) from the drop menu.', ALM_NAME) . '</p>';
76
  echo '</div>';
77
  echo '<div class="wrap"><div class="inner"><select name="tag-select" id="tag-select">';
78
  echo '<option value="" selected="selected">-- ' . __('Select Tag', ALM_NAME) . ' --</option>';
@@ -84,6 +84,54 @@
84
  echo '</div>';
85
  }
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  // List Authors
88
  $authors = get_users();
89
  if($authors){
@@ -91,12 +139,12 @@
91
  echo '<h3 class="heading">' . __('Author', ALM_NAME) . '</h3>';
92
  echo '<div class="expand-wrap">';
93
  echo '<div class="section-title">';
94
- echo '<p>' . __('Select an Author to query(by ID) from the drop menu.', ALM_NAME) . '</p>';
95
  echo '</div>';
96
  echo '<div class="wrap"><div class="inner"><select name="author-select" id="author-select">';
97
  echo '<option value="" selected="selected">-- ' . __('Select Author', ALM_NAME) . ' --</option>';
98
  foreach( $authors as $author ){
99
- echo '<option name="chk-'.$author->user_login.'" id="chk-'.$author->user_login.'" value="'.$author->user_login.'">'.$author->display_name.'</option>';
100
  }
101
  echo '</select></div></div>';
102
  echo '</div>';
@@ -118,10 +166,42 @@
118
  </div>
119
  </div>
120
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  <!-- Exclude posts -->
123
  <div class="row input exclude" id="alm-exclude-posts">
124
- <h3 class="heading"><?php _e('Exclude Posts', ALM_NAME); ?></h3>
125
  <div class="expand-wrap">
126
  <div class="section-title">
127
  <p><?php _e('A comma separated list of post ID\'s to exclude from query.', ALM_NAME); ?></p>
@@ -136,21 +216,21 @@
136
 
137
  <!-- Offset -->
138
  <div class="row input offset" id="alm-offset">
139
- <h3 class="heading"><?php _e('Post Offset', ALM_NAME); ?></h3>
140
  <div class="expand-wrap">
141
  <div class="section-title">
142
- <p><?php _e('Offset the initial query by selecting a value from the drop menu.', ALM_NAME); ?></p>
143
  </div>
144
  <div class="wrap">
145
  <div class="inner">
146
  <select name="offset-select" id="offset-select">
147
  <script>
148
- var length = 10,
149
  value = '';
150
  for(var i = 0; i < length; i++){
151
  value += '<option value="'+i+'">'+i+'</option>';
152
  }
153
- $('#offset-select').append(value);
154
  </script>
155
  </select>
156
  </div>
@@ -169,7 +249,7 @@
169
  <div class="inner">
170
  <select name="display_posts-select" id="display_posts-select">
171
  <script>
172
- var length = 22,
173
  value = '';
174
  for(var i = 1; i < length; i++){
175
  if(i == 5){
@@ -178,7 +258,7 @@
178
  value += '<option value="'+i+'">'+i+'</option>';
179
  }
180
  }
181
- $('#display_posts-select').append(value);
182
  </script>
183
  </select>
184
  </div>
@@ -205,7 +285,7 @@
205
  <input type="radio" name="scroll" value="f" id="scroll_f">
206
  <label for="scroll_f"><?php _e('False', ALM_NAME); ?></label>
207
  </li>
208
- </select>
209
  </div>
210
  </div>
211
  </div>
@@ -233,7 +313,7 @@
233
  }
234
  }
235
  value += '<option value="none"><?php _e('Unlimited', ALM_NAME); ?></option>';
236
- $('#max-select').append(value);
237
  </script>
238
  </select>
239
  </div>
@@ -252,15 +332,15 @@
252
  <div class="wrap">
253
  <div class="inner">
254
  <ul>
255
- <li>
256
- <input type="radio" name="pause" value="t" id="pause_t">
257
- <label for="pause_t"><?php _e('True', ALM_NAME); ?></label>
258
- </li>
259
- <li>
260
- <input type="radio" name="pause" value="f" id="pause_f" checked>
261
- <label for="pause_f"><?php _e('False', ALM_NAME); ?></label>
262
- </li>
263
- </select>
264
  </div>
265
  </div>
266
  </div>
@@ -275,11 +355,17 @@
275
  <p><?php _e('Select a loading transition from the drop menu.', ALM_NAME); ?></p>
276
  </div>
277
  <div class="wrap">
278
- <div class="inner">
279
- <select name="transition-select" id="transition-select">
280
- <option value="slide" selected="selected"><?php _e('Slide', ALM_NAME); ?></option>
281
- <option value="fade"><?php _e('Fade', ALM_NAME); ?></option>
282
- </select>
 
 
 
 
 
 
283
  </div>
284
  </div>
285
  </div>
1
+ <span class="toggle-all"><span class="inner-wrap"><em class="collapse"><?php _e('Collapse All', ALM_NAME); ?></em><em class="expand"><?php _e('Expand All', ALM_NAME); ?></em></span></span>
2
 
3
  <?php
4
  // List available repeaters
6
  echo '<h3 class="heading">'.__('Repeater', ALM_NAME). '</h3>';
7
  echo '<div class="expand-wrap">';
8
  echo '<div class="section-title">';
9
+ echo '<p>'.__('Choose your <a href="admin.php?page=ajax-load-more-repeaters" target="_parent">repeater</a>.', ALM_NAME). '</p>';
10
  echo '</div>';
11
  echo '<div class="wrap"><div class="inner">';
12
  echo '<select name="repeater-select" id="repeater-select">';
45
  echo '</div>';
46
  echo '</div>';
47
  }
48
+
49
  // List Categories
50
  $cats = get_categories();
51
  if($cats){
53
  echo '<h3 class="heading">' . __('Category', ALM_NAME) . '</h3>';
54
  echo '<div class="expand-wrap">';
55
  echo '<div class="section-title">';
56
+ echo '<p>' . __('Select a Category to query(by slug).', ALM_NAME) . '</p>';
57
  echo '</div>';
58
  echo '<div class="wrap"><div class="inner"><select name="category-select" id="category-select">';
59
  echo '<option value="" selected="selected">-- ' . __('Select Category', ALM_NAME) . ' --</option>';
72
  echo '<h3 class="heading">' . __('Tag', ALM_NAME) . '</h3>';
73
  echo '<div class="expand-wrap">';
74
  echo '<div class="section-title">';
75
+ echo '<p>' . __('Select a Tag to query(by slug).', ALM_NAME) . '</p>';
76
  echo '</div>';
77
  echo '<div class="wrap"><div class="inner"><select name="tag-select" id="tag-select">';
78
  echo '<option value="" selected="selected">-- ' . __('Select Tag', ALM_NAME) . ' --</option>';
84
  echo '</div>';
85
  }
86
 
87
+
88
+ // List Taxonomies
89
+ $tax_args = array(
90
+ 'public' => true,
91
+ '_builtin' => false
92
+ );
93
+ $tax_output = 'objects'; // or objects
94
+ $taxonomies = get_taxonomies( $tax_args, $tax_output );
95
+ if ( $taxonomies ) {
96
+ echo '<div class="row taxonomy" id="alm-taxonomy">';
97
+ echo '<h3 class="heading">'.__('Taxonomy', ALM_NAME). '</h3>';
98
+ echo '<div class="expand-wrap">';
99
+ echo '<div class="section-title">';
100
+ echo '<p>'.__('Select your custom taxonomy then select the terms and operator.', ALM_NAME). '</p>';
101
+ echo '</div>';
102
+
103
+ echo '<div class="wrap">';
104
+
105
+ echo '<div class="inner">';
106
+ echo '<select name="taxonomy-select" id="taxonomy-select">';
107
+ echo '<option value="" selected="selected">-- ' . __('Select Taxonomy', ALM_NAME) . ' --</option>';
108
+ foreach( $taxonomies as $taxonomy ){
109
+ echo '<option name="chk-'.$taxonomy->query_var.'" id="chk-'.$taxonomy->query_var.'" value="'.$taxonomy->query_var.'">'.$taxonomy->label.'</option>';
110
+ }
111
+ echo '</select>';
112
+ echo '</div>';
113
+
114
+ echo '<div id="taxonomy-extended">';
115
+ echo '<div class="inner border-top" id="tax-terms">';
116
+ echo '<label class="full">'. __('Taxonomy Terms:', ALM_NAME) .'</label>';
117
+ echo '<div id="tax-terms-container" class="checkboxes"></div>';
118
+ echo '</div>';
119
+
120
+ echo '<div class="inner border-top" id="tax-operator-select">';
121
+ echo '<label class="full">'. __('Taxonomy Operator:', ALM_NAME) .'</label>';
122
+ echo '<ul class="radio">';
123
+ echo '<li><input name="tax-operator" id="tax-in-radio" value="IN" type="radio" checked="checked"><label for="tax-in-radio">IN (default)</li>';
124
+ 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>';
125
+ echo '</ul>';
126
+ echo '</div>';
127
+ echo '</div>';
128
+
129
+ echo '</div>';
130
+ echo '</div>';
131
+ echo '</div>';
132
+ }
133
+
134
+
135
  // List Authors
136
  $authors = get_users();
137
  if($authors){
139
  echo '<h3 class="heading">' . __('Author', ALM_NAME) . '</h3>';
140
  echo '<div class="expand-wrap">';
141
  echo '<div class="section-title">';
142
+ echo '<p>' . __('Select an Author to query(by ID).', ALM_NAME) . '</p>';
143
  echo '</div>';
144
  echo '<div class="wrap"><div class="inner"><select name="author-select" id="author-select">';
145
  echo '<option value="" selected="selected">-- ' . __('Select Author', ALM_NAME) . ' --</option>';
146
  foreach( $authors as $author ){
147
+ echo '<option name="chk-'.$author->user_login.'" id="chk-'.$author->user_login.'" value="'.$author->ID.'">'.$author->display_name.'</option>';
148
  }
149
  echo '</select></div></div>';
150
  echo '</div>';
166
  </div>
167
  </div>
168
  </div>
169
+
170
+ <!-- Ordering -->
171
+ <div class="row ordering" id="alm-order">
172
+ <h3 class="heading"><?php _e('Ordering', ALM_NAME); ?></h3>
173
+ <div class="expand-wrap">
174
+ <div class="section-title">
175
+ <p><?php _e('Sort retrieved posts by Order and Orderby parameters.', ALM_NAME); ?></p>
176
+ </div>
177
+ <div class="wrap">
178
+ <div class="inner half">
179
+ <label class="full">Order:</label>
180
+ <select name="post-order" id="post-order">
181
+ <option value="DESC" selected="selected">DESC (default)</option>
182
+ <option value="ASC">ASC</option>
183
+ </select>
184
+ </div>
185
+ <div class="inner half">
186
+ <label class="full">Order By:</label>
187
+ <select name="post-orderby" id="post-orderby">
188
+ <option value="date" selected="selected">Date (default)</option>
189
+ <option value="title">Title</option>
190
+ <option value="name">Name (slug)</option>
191
+ <option value="menu_order">Menu Order</option>
192
+ <option value="rand">Random</option>
193
+ <option value="author">Author</option>
194
+ <option value="ID">ID</option>
195
+ <option value="comment_count">Comment Count</option>
196
+ </select>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ </div>
201
 
202
  <!-- Exclude posts -->
203
  <div class="row input exclude" id="alm-exclude-posts">
204
+ <h3 class="heading"><?php _e('Exclude', ALM_NAME); ?></h3>
205
  <div class="expand-wrap">
206
  <div class="section-title">
207
  <p><?php _e('A comma separated list of post ID\'s to exclude from query.', ALM_NAME); ?></p>
216
 
217
  <!-- Offset -->
218
  <div class="row input offset" id="alm-offset">
219
+ <h3 class="heading"><?php _e('Offset', ALM_NAME); ?></h3>
220
  <div class="expand-wrap">
221
  <div class="section-title">
222
+ <p><?php _e('Offset the initial WordPress query by <em>\'n\'</em> number of posts', ALM_NAME); ?></p>
223
  </div>
224
  <div class="wrap">
225
  <div class="inner">
226
  <select name="offset-select" id="offset-select">
227
  <script>
228
+ var length = 21,
229
  value = '';
230
  for(var i = 0; i < length; i++){
231
  value += '<option value="'+i+'">'+i+'</option>';
232
  }
233
+ jQuery('#offset-select').append(value);
234
  </script>
235
  </select>
236
  </div>
249
  <div class="inner">
250
  <select name="display_posts-select" id="display_posts-select">
251
  <script>
252
+ var length = 31,
253
  value = '';
254
  for(var i = 1; i < length; i++){
255
  if(i == 5){
258
  value += '<option value="'+i+'">'+i+'</option>';
259
  }
260
  }
261
+ jQuery('#display_posts-select').append(value);
262
  </script>
263
  </select>
264
  </div>
285
  <input type="radio" name="scroll" value="f" id="scroll_f">
286
  <label for="scroll_f"><?php _e('False', ALM_NAME); ?></label>
287
  </li>
288
+ </ul>
289
  </div>
290
  </div>
291
  </div>
313
  }
314
  }
315
  value += '<option value="none"><?php _e('Unlimited', ALM_NAME); ?></option>';
316
+ jQuery('#max-select').append(value);
317
  </script>
318
  </select>
319
  </div>
332
  <div class="wrap">
333
  <div class="inner">
334
  <ul>
335
+ <li>
336
+ <input type="radio" name="pause" value="t" id="pause_t">
337
+ <label for="pause_t"><?php _e('True', ALM_NAME); ?></label>
338
+ </li>
339
+ <li>
340
+ <input type="radio" name="pause" value="f" id="pause_f" checked>
341
+ <label for="pause_f"><?php _e('False', ALM_NAME); ?></label>
342
+ </li>
343
+ </ul>
344
  </div>
345
  </div>
346
  </div>
355
  <p><?php _e('Select a loading transition from the drop menu.', ALM_NAME); ?></p>
356
  </div>
357
  <div class="wrap">
358
+ <div class="inner">
359
+ <ul>
360
+ <li>
361
+ <input type="radio" name="transition" value="slide" id="transition-slide" checked>
362
+ <label for="transition-slide"><?php _e('Slide', ALM_NAME); ?></label>
363
+ </li>
364
+ <li>
365
+ <input type="radio" name="transition" value="fade" id="transition-fade">
366
+ <label for="transition-fade"><?php _e('Fade', ALM_NAME); ?></label>
367
+ </li>
368
+ </ul>
369
  </div>
370
  </div>
371
  </div>
admin/js/editor-btn.js CHANGED
@@ -8,7 +8,7 @@
8
  if(h > 600) h = 600;
9
  editor.addCommand('mcebutton', function () {
10
  editor.windowManager.open({
11
- title: "Ajax load More: Shortcode Builder",
12
  file: ajaxurl + '?action=fscb', // file that contains HTML for our modal window
13
  width: w, // size of our window
14
  height: h , // size of our window
8
  if(h > 600) h = 600;
9
  editor.addCommand('mcebutton', function () {
10
  editor.windowManager.open({
11
+ title: "Ajax load More: Shortcode Builder",
12
  file: ajaxurl + '?action=fscb', // file that contains HTML for our modal window
13
  width: w, // size of our window
14
  height: h , // size of our window
admin/js/shortcode-builder.js CHANGED
@@ -1,7 +1,7 @@
1
- $(document).ready(function() {
2
  "use strict";
3
 
4
- $(".row select").select2({
5
  minimumResultsForSearch: '100'
6
  });
7
 
@@ -42,19 +42,60 @@ $(document).ready(function() {
42
  if(post_type_count>1){
43
  output += ', ' + $(this).data('type');
44
  }else{
45
- if($('.post_types input').hasClass('changed'))
46
- output += ' post_type="'+$(this).data('type')+'';
 
47
  }
48
  }
49
  });
50
  if(post_type_count>0)
51
  output += '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  // ---------------------------
53
  // - Categories
54
  // ---------------------------
55
 
56
  var cat = $('.categories select').val();
57
- if(cat != '' && cat != undefined)
58
  output += ' category="'+cat+'"';
59
 
60
  // ---------------------------
@@ -62,7 +103,7 @@ $(document).ready(function() {
62
  // ---------------------------
63
 
64
  var tag = $('.tags select').val();
65
- if(tag != '' && tag != undefined)
66
  output += ' tag="'+tag+'"';
67
 
68
  // ---------------------------
@@ -70,7 +111,7 @@ $(document).ready(function() {
70
  // ---------------------------
71
 
72
  var author = $('.authors select').val();
73
- if(author != '' && author != undefined)
74
  output += ' author="'+author+'"';
75
 
76
 
@@ -80,18 +121,34 @@ $(document).ready(function() {
80
 
81
  var search = $('.search-term input').val();
82
  search = $.trim(search);
83
- if(search != '')
84
  output += ' search="'+search+'"';
85
 
86
 
 
 
 
 
 
 
 
 
 
 
 
87
  // ---------------------------
88
  // - Exclude posts
89
  // ---------------------------
90
 
91
  var exclude = $('.exclude input').val();
92
  exclude = $.trim(exclude);
93
- if(exclude != '')
94
- output += ' exclude="'+exclude+'"';
 
 
 
 
 
95
 
96
 
97
  // ---------------------------
@@ -108,7 +165,7 @@ $(document).ready(function() {
108
  // ---------------------------
109
 
110
  var posts_per_page = $('.posts_per_page select').val();
111
- if(posts_per_page > 0 && posts_per_page != 5 && $('.posts_per_page select').hasClass('changed'))
112
  output += ' posts_per_page="'+posts_per_page+'"';
113
 
114
 
@@ -117,7 +174,7 @@ $(document).ready(function() {
117
  // ---------------------------
118
 
119
  var scroll_load = $('.scroll_load input[name=scroll]:checked').val();
120
- if(scroll_load == 'f'){
121
  $('.row.max_pages').slideUp(100, 'alm_easeInOutQuad');
122
  if($('.scroll_load input').hasClass('changed'))
123
  output += ' scroll="false"';
@@ -134,7 +191,7 @@ $(document).ready(function() {
134
  // ---------------------------
135
 
136
  var pause_load = $('.pause_load input[name=pause]:checked').val();
137
- if(pause_load == 't')
138
  output += ' pause="true"';
139
 
140
 
@@ -142,8 +199,8 @@ $(document).ready(function() {
142
  // - transition
143
  // ---------------------------
144
 
145
- var transition = $('.transition select').val();
146
- if($('.transition select').hasClass('changed'))
147
  output += ' transition="'+transition+'"';
148
 
149
 
@@ -153,7 +210,7 @@ $(document).ready(function() {
153
 
154
  var btn_lbl = $('.btn-label input').val();
155
  btn_lbl = $.trim(btn_lbl);
156
- if(btn_lbl != '' && $('.btn-label input').hasClass('changed'))
157
  output += ' button_label="'+btn_lbl+'"';
158
 
159
 
@@ -165,21 +222,31 @@ $(document).ready(function() {
165
  /*
166
  * On change events
167
  *
168
- * @since 1.0
169
  */
170
 
171
  $('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed'); //Select post by default
172
 
173
- $('.repeater select, .post_types input[type=checkbox], .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 select').change(function() {
174
  $(this).addClass('changed');
175
 
176
- // If post type is not selected, select post.
177
  if(!$('.post_types input[type=checkbox]:checked').length > 0){
178
  $('.post_types input[type=checkbox]#chk-post').prop('checked', true);
 
 
 
 
179
  }
180
-
181
- _alm.buildShortcode();
182
  });
 
 
 
 
 
 
183
  $('.search-term input, .exclude input, .btn-label input').keyup(function() {
184
  $(this).addClass('changed');
185
  _alm.buildShortcode();
@@ -190,7 +257,7 @@ $(document).ready(function() {
190
  /*
191
  * Jump to section
192
  *
193
- * @since 1.0
194
  */
195
 
196
  var jumpOptions = '';
@@ -204,7 +271,7 @@ $(document).ready(function() {
204
 
205
  $('select.jump-menu').change(function() {
206
  var pos = $(this).val();
207
- if(pos!= 'null'){
208
  $('html,body').animate({
209
  scrollTop: $('#'+pos).offset().top - ($('.intro').height() - 20)
210
  }, 200, 'alm_easeInOutQuad');
@@ -215,7 +282,7 @@ $(document).ready(function() {
215
  /*
216
  * Expand/Collapse shortcode headings
217
  *
218
- * @since 1.0
219
  */
220
 
221
  $('h3.heading').click(function(){
@@ -231,13 +298,55 @@ $(document).ready(function() {
231
  }
232
  });
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
 
236
  /*
237
  * _alm.alm_easeInOutQuad
238
  * Ajax Load More easing
239
  *
240
- * @since 1.0
241
  */
242
 
243
  $.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
@@ -251,7 +360,7 @@ $(document).ready(function() {
251
  * _alm.SelectText
252
  * Click to select text
253
  *
254
- * @since 1.0
255
  */
256
 
257
  _alm.SelectText = function(element) {
@@ -281,7 +390,7 @@ $(document).ready(function() {
281
  * _alm.copyToClipboard
282
  * Copy shortcode to clipboard
283
  *
284
- * @since 1.0
285
  */
286
 
287
  _alm.copyToClipboard = function(text) {
1
+ jQuery(document).ready(function($) {
2
  "use strict";
3
 
4
+ $(".row select, .alm-main select").select2({
5
  minimumResultsForSearch: '100'
6
  });
7
 
42
  if(post_type_count>1){
43
  output += ', ' + $(this).data('type');
44
  }else{
45
+ if($(this).hasClass('changed')){
46
+ output += ' post_type="'+$(this).data('type')+'';
47
+ }
48
  }
49
  }
50
  });
51
  if(post_type_count>0)
52
  output += '"';
53
+
54
+
55
+ // ---------------------------
56
+ // - Taxonomy Query
57
+ // ---------------------------
58
+
59
+ var tax = $('select#taxonomy-select').val(),
60
+ tax_operator = $('#tax-operator-select input[name=tax-operator]:checked').val();
61
+
62
+ if(tax !== '' && tax !== undefined){
63
+ output += ' taxonomy="'+tax+'"';
64
+ if($('select#taxonomy-select').hasClass('changed')){
65
+ $('#taxonomy-extended').slideDown(200, 'alm_easeInOutQuad');
66
+ get_tax_terms(tax);
67
+ $('select#taxonomy-select').removeClass('changed');
68
+ }
69
+
70
+ var tax_term_count = 0;
71
+ $('#tax-terms-container input[type=checkbox]').each(function(e){
72
+ if($(this).is(":checked")) {
73
+ tax_term_count++;
74
+ if(tax_term_count>1){
75
+ output += ', ' + $(this).data('type');
76
+ }else{
77
+ if($('#tax-terms-container input').hasClass('changed'))
78
+ output += ' taxonomy_terms="'+$(this).data('type')+'';
79
+ }
80
+ }
81
+ });
82
+ if(tax_term_count>0)
83
+ output += '"';
84
+
85
+ //Get Tax Operator
86
+ if(tax_operator !== '' && tax_operator !== 'IN' && tax_operator !== undefined && tax_term_count !== 0){
87
+ output += ' taxonomy_operator="'+tax_operator+'"';
88
+ }
89
+ }else{
90
+ $('#taxonomy-extended').slideUp(200, 'alm_easeInOutQuad');
91
+ }
92
+
93
  // ---------------------------
94
  // - Categories
95
  // ---------------------------
96
 
97
  var cat = $('.categories select').val();
98
+ if(cat !== '' && cat !== undefined)
99
  output += ' category="'+cat+'"';
100
 
101
  // ---------------------------
103
  // ---------------------------
104
 
105
  var tag = $('.tags select').val();
106
+ if(tag !== '' && tag !== undefined)
107
  output += ' tag="'+tag+'"';
108
 
109
  // ---------------------------
111
  // ---------------------------
112
 
113
  var author = $('.authors select').val();
114
+ if(author !== '' && author !== undefined)
115
  output += ' author="'+author+'"';
116
 
117
 
121
 
122
  var search = $('.search-term input').val();
123
  search = $.trim(search);
124
+ if(search !== '')
125
  output += ' search="'+search+'"';
126
 
127
 
128
+ // ---------------------------
129
+ // - Ordering
130
+ // ---------------------------
131
+ var order = $('select#post-order').val(),
132
+ orderby = $('select#post-orderby').val();
133
+ if(order !== 'DESC')
134
+ output += ' order="'+order+'"';
135
+ if(orderby !== 'date')
136
+ output += ' orderby="'+orderby+'"';
137
+
138
+
139
  // ---------------------------
140
  // - Exclude posts
141
  // ---------------------------
142
 
143
  var exclude = $('.exclude input').val();
144
  exclude = $.trim(exclude);
145
+ if(exclude !== ''){
146
+ //Remove trailing comma, if present
147
+ if(exclude.charAt( exclude.length-1 ) == ",") {
148
+ exclude = exclude.slice(0, -1)
149
+ }
150
+ output += ' exclude="'+exclude+'"';
151
+ }
152
 
153
 
154
  // ---------------------------
165
  // ---------------------------
166
 
167
  var posts_per_page = $('.posts_per_page select').val();
168
+ if(posts_per_page > 0 && posts_per_page !== 5 && $('.posts_per_page select').hasClass('changed'))
169
  output += ' posts_per_page="'+posts_per_page+'"';
170
 
171
 
174
  // ---------------------------
175
 
176
  var scroll_load = $('.scroll_load input[name=scroll]:checked').val();
177
+ if(scroll_load === 'f'){
178
  $('.row.max_pages').slideUp(100, 'alm_easeInOutQuad');
179
  if($('.scroll_load input').hasClass('changed'))
180
  output += ' scroll="false"';
191
  // ---------------------------
192
 
193
  var pause_load = $('.pause_load input[name=pause]:checked').val();
194
+ if(pause_load === 't')
195
  output += ' pause="true"';
196
 
197
 
199
  // - transition
200
  // ---------------------------
201
 
202
+ var transition = $('.transition input[name=transition]:checked').val();
203
+ if(transition !== 'slide')
204
  output += ' transition="'+transition+'"';
205
 
206
 
210
 
211
  var btn_lbl = $('.btn-label input').val();
212
  btn_lbl = $.trim(btn_lbl);
213
+ if(btn_lbl !== '' && $('.btn-label input').hasClass('changed'))
214
  output += ' button_label="'+btn_lbl+'"';
215
 
216
 
222
  /*
223
  * On change events
224
  *
225
+ * @since 2.0.0
226
  */
227
 
228
  $('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed'); //Select post by default
229
 
230
+ $('.repeater select, .post_types input[type=checkbox], .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() {
231
  $(this).addClass('changed');
232
 
233
+ // If post type is not selected, select 'post'.
234
  if(!$('.post_types input[type=checkbox]:checked').length > 0){
235
  $('.post_types input[type=checkbox]#chk-post').prop('checked', true);
236
+ }
237
+ // If Tax Term Operator is not selected, select 'IN'.
238
+ if(!$('#tax-operator-select input[type=radio]:checked').length > 0){
239
+ $('#tax-operator-select input[type=radio]#tax-in-radio').prop('checked', true);
240
  }
241
+
242
+ _alm.buildShortcode();
243
  });
244
+
245
+ $(document).on('change', '#tax-terms-container input[type=checkbox]', function() {
246
+ $(this).addClass('changed');
247
+ _alm.buildShortcode();
248
+ });
249
+
250
  $('.search-term input, .exclude input, .btn-label input').keyup(function() {
251
  $(this).addClass('changed');
252
  _alm.buildShortcode();
257
  /*
258
  * Jump to section
259
  *
260
+ * @since 2.0.0
261
  */
262
 
263
  var jumpOptions = '';
271
 
272
  $('select.jump-menu').change(function() {
273
  var pos = $(this).val();
274
+ if(pos !== 'null'){
275
  $('html,body').animate({
276
  scrollTop: $('#'+pos).offset().top - ($('.intro').height() - 20)
277
  }, 200, 'alm_easeInOutQuad');
282
  /*
283
  * Expand/Collapse shortcode headings
284
  *
285
+ * @since 2.0.0
286
  */
287
 
288
  $('h3.heading').click(function(){
298
  }
299
  });
300
 
301
+ $('.toggle-all').click(function(e){
302
+ var el = $(this);
303
+ if($(el).hasClass('closed')){
304
+ $(el).removeClass('closed');
305
+ $('h3.heading').removeClass('open');
306
+ $('.expand-wrap').slideDown(100, 'alm_easeInOutQuad');
307
+ }else{
308
+ $(el).addClass('closed');
309
+ $('h3.heading').addClass('open');
310
+ $('.expand-wrap').slideUp(100, 'alm_easeInOutQuad');
311
+ }
312
+ });
313
+
314
+
315
+ /*
316
+ * get_tax_terms
317
+ * Get taxonomy terms via ajax
318
+ *
319
+ * @since 2.1.0
320
+ */
321
+ function get_tax_terms(tax){
322
+ var placement = $('#tax-terms-container');
323
+ placement.html("<p class='loading'>Fetching Terms...</p>");
324
+ $.ajax({
325
+ type: 'GET',
326
+ url: window.parent.alm_admin_localize.ajax_admin_url,
327
+ data: {
328
+ action: 'alm_get_tax_terms',
329
+ taxonomy: tax,
330
+ nonce: window.parent.alm_admin_localize.alm_admin_nonce,
331
+ },
332
+ dataType: "html",
333
+ success: function(data) {
334
+ //console.log(data);
335
+ placement.html(data);
336
+ },
337
+ error: function(xhr, status, error) {
338
+ responseText.html('<p>Error - Something went wrong and the terms could not be retrieved.');
339
+ }
340
+ });
341
+ }
342
+
343
 
344
 
345
  /*
346
  * _alm.alm_easeInOutQuad
347
  * Ajax Load More easing
348
  *
349
+ * @since 2.0.0
350
  */
351
 
352
  $.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
360
  * _alm.SelectText
361
  * Click to select text
362
  *
363
+ * @since 2.0.0
364
  */
365
 
366
  _alm.SelectText = function(element) {
390
  * _alm.copyToClipboard
391
  * Copy shortcode to clipboard
392
  *
393
+ * @since 2.0.0
394
  */
395
 
396
  _alm.copyToClipboard = function(text) {
ajax-load-more.php CHANGED
@@ -1,19 +1,19 @@
1
  <?php
2
  /*
3
  Plugin Name: Ajax Load More
4
- Plugin URI: http://connekthq.com/ajax-load-more
5
- Description: A simple solution for Ajax loading of WordPress Posts and Pages.
6
  Author: Darren Cooney
7
  Twitter: @KaptonKaos
8
  Author URI: http://connekthq.com
9
- Version: 2.0.5
10
  License: GPL
11
  Copyright: Darren Cooney & Connekt Media
12
  */
13
 
14
 
15
- define('ALM_VERSION', '2.0.5');
16
- define('ALM_RELEASE', 'June 13, 2014');
17
 
18
  /*
19
  * alm_install
@@ -76,8 +76,7 @@ if( !class_exists('AjaxLoadMore') ):
76
  add_shortcode('ajax_load_more', array(&$this, 'alm_shortcode'));
77
 
78
  // Allow shortcodes in widget areas
79
- add_filter('widget_text', array(&$this, 'shortcode_unautop'));
80
- add_filter('widget_text', array(&$this, 'do_shortcode'));
81
 
82
  // load text domain
83
  load_plugin_textdomain( 'ajax-load-more', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
@@ -141,9 +140,13 @@ if( !class_exists('AjaxLoadMore') ):
141
  'post_type' => 'post',
142
  'category' => '',
143
  'taxonomy' => '',
 
 
144
  'tag' => '',
145
  'author' => '',
146
  'search' => '',
 
 
147
  'exclude' => '',
148
  'offset' => '0',
149
  'posts_per_page' => '5',
@@ -174,7 +177,7 @@ if( !class_exists('AjaxLoadMore') ):
174
  $btn_color = ' '.$options['_alm_btn_color'];
175
  }
176
 
177
- return '<'.$wrap_element.' id="ajax-load-more" class="'. $btn_color .'"><'.$container_element.' class="alm-listing'. $classname . '" data-repeater="'.$repeater.'" data-post-type="'.$post_type.'" data-category="'.$category.'" data-taxonomy="'.$taxonomy.'" data-tag="'.$tag.'" data-author="'.$author.'" data-exclude="'.$exclude.'" data-offset="'.$offset.'" data-posts-per-page="'.$posts_per_page.'" data-search="'.$search.'" data-scroll="'.$scroll.'" data-max-pages="'.$max_pages.'" data-pause="'. $pause .'" data-button-label="'.$button_label.'" data-transition="'.$transition.'"></'.$container_element.'></'.$wrap_element.'>';
178
  }
179
 
180
 
@@ -197,9 +200,19 @@ if( !class_exists('AjaxLoadMore') ):
197
  $postType = (isset($_GET['postType'])) ? $_GET['postType'] : 'post';
198
  $category = (isset($_GET['category'])) ? $_GET['category'] : '';
199
  $author_id = (isset($_GET['author'])) ? $_GET['author'] : '';
 
200
  $taxonomy = (isset($_GET['taxonomy'])) ? $_GET['taxonomy'] : '';
 
 
 
 
 
 
 
201
  $tag = (isset($_GET['tag'])) ? $_GET['tag'] : '';
202
  $s = (isset($_GET['search'])) ? $_GET['search'] : '';
 
 
203
  $exclude = (isset($_GET['exclude'])) ? $_GET['exclude'] : '';
204
  $numPosts = (isset($_GET['numPosts'])) ? $_GET['numPosts'] : 6;
205
  $page = (isset($_GET['pageNumber'])) ? $_GET['pageNumber'] : 0;
@@ -211,14 +224,15 @@ if( !class_exists('AjaxLoadMore') ):
211
  $args = array(
212
  'post_type' => $postType,
213
  'category_name' => $category,
 
214
  'author' => $author_id,
215
  'posts_per_page' => $numPosts,
216
  'offset' => $offset + ($numPosts*$page),
217
  's' => $s,
218
- 'orderby' => 'date',
219
- 'order' => 'DESC',
220
  'post_status' => 'publish',
221
- 'ignore_sticky_posts' => true,
222
  );
223
 
224
 
@@ -230,14 +244,20 @@ if( !class_exists('AjaxLoadMore') ):
230
  }
231
 
232
 
233
- // Query by Taxonomy/Tag - Taxonomy is deprecated for now
234
-
235
- if(empty($taxonomy)){
236
- $args['tag'] = $tag;
237
- }else{
238
- $args[$taxonomy] = $tag;
239
- }
240
-
 
 
 
 
 
 
241
 
242
  // Query by $args
243
 
@@ -247,31 +267,37 @@ if( !class_exists('AjaxLoadMore') ):
247
  // the WP loop
248
 
249
  if ($alm_query->have_posts()) :
250
- while ($alm_query->have_posts()): $alm_query->the_post();
251
-
252
  $file = $repeater;
253
  $include = '';
254
- if (has_action('alm_repeater_installed')){ // If Custom Repeaters is installed
255
- if($file == 'repeater1'){
256
- $include = ALM_REPEATER_PATH . 'repeaters/repeater1.php';
257
- }elseif($file == 'repeater2'){
258
- $include = ALM_REPEATER_PATH . 'repeaters/repeater2.php';
259
- }elseif($file == 'repeater3'){
260
- $include = ALM_REPEATER_PATH . 'repeaters/repeater3.php';
261
- }elseif($file == 'repeater4'){
262
- $include = ALM_REPEATER_PATH . 'repeaters/repeater4.php';
263
- }elseif($file == 'repeater5'){
264
- $include = ALM_REPEATER_PATH . 'repeaters/repeater5.php';
265
- }else{
266
- $include = plugin_dir_path( __FILE__ ) . 'core/repeater/default.php';
267
- }
 
 
 
 
 
 
268
  }else{
269
  $include = plugin_dir_path( __FILE__ ) . 'core/repeater/default.php';
270
- }
271
 
 
272
  include( $include );
273
 
274
- endwhile;
275
  endif;
276
  wp_reset_query();
277
  exit;
1
  <?php
2
  /*
3
  Plugin Name: Ajax Load More
4
+ Plugin URI: http://connekthq.com/plugins/ajax-load-more
5
+ Description: A simple yet powerful solution for lazy loading WordPress posts and pages with Ajax.
6
  Author: Darren Cooney
7
  Twitter: @KaptonKaos
8
  Author URI: http://connekthq.com
9
+ Version: 2.1.1
10
  License: GPL
11
  Copyright: Darren Cooney & Connekt Media
12
  */
13
 
14
 
15
+ define('ALM_VERSION', '2.1.1');
16
+ define('ALM_RELEASE', 'July 20, 2014');
17
 
18
  /*
19
  * alm_install
76
  add_shortcode('ajax_load_more', array(&$this, 'alm_shortcode'));
77
 
78
  // Allow shortcodes in widget areas
79
+ add_filter('widget_text', 'do_shortcode');
 
80
 
81
  // load text domain
82
  load_plugin_textdomain( 'ajax-load-more', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
140
  'post_type' => 'post',
141
  'category' => '',
142
  'taxonomy' => '',
143
+ 'taxonomy_terms' => '',