WordPress Infinite Scroll – Ajax Load More - Version 2.0.3

Version Description

  • Fixed issue with WP auto updates overriding the default repeater. Please deactivate and then activate your plugin.
Download this release

Release Info

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

Version 2.0.3

LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
README.txt ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Ajax Load More ===
2
+ Contributors: dcooney
3
+ 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.2
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 ==
81
+
82
+
83
+ = What are my server requirements? =
84
+
85
+ Your server must be able to read/write/create files. Ajax Load More creates the default repeater on plugin activation and in order to modify the output you are required to write to the file as well.
86
+
87
+ = Is the ajax functionality secure? =
88
+
89
+ Yes, Ajax Load more uses admin-ajax and nonces in order to protect URLs and forms from being misused.
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
+
101
+ How to install Ajax Load More.
102
+
103
+ = Using The WordPress Dashboard =
104
+
105
+ 1. Navigate to the 'Add New' in the plugins dashboard
106
+ 2. Search for 'Ajax Load More'
107
+ 3. Click 'Install Now'
108
+ 4. Activate the plugin on the Plugin dashboard
109
+
110
+ = Uploading in WordPress Dashboard =
111
+
112
+ 1. Navigate to the 'Add New' in the plugins dashboard
113
+ 2. Navigate to the 'Upload' area
114
+ 3. Select `ajax-load-more.zip` from your computer
115
+ 4. Click 'Install Now'
116
+ 5. Activate the plugin in the Plugin dashboard
117
+
118
+ = Using FTP =
119
+
120
+ 1. Download `ajax-load-more.zip`
121
+ 2. Extract the `ajax-load-more` directory to your computer
122
+ 3. Upload the `ajax-load-more` directory to the `/wp-content/plugins/` directory
123
+ 4. Activate the plugin in the Plugin dashboard
124
+
125
+
126
+ == Screenshots ==
127
+
128
+ 1. Settings screen
129
+ 2. The collection of available repeaters
130
+ 3. Shortcode Builder (Admin screen)
131
+ 4. Shortcode Builder (Page Edit screen)
132
+ 5. Content Editor shortcode icon
133
+ 6. Shortcode and implementation examples
134
+
135
+ == Changelog ==
136
+
137
+ = 2.0.3 =
138
+ * Fixed issue with WP auto updates overriding the default repeater. Please deactivate and then activate your plugin.
139
+
140
+ = 2.0.2 =
141
+ * Fixed issue with tinymce conflict
142
+
143
+ = 2.0.1 =
144
+ * Ajax Load More
145
+
146
+ == Upgrade Notice ==
147
+
148
+ * None
149
+
150
+
admin/admin.php ADDED
@@ -0,0 +1,713 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* Admin function */
4
+
5
+
6
+ add_action( 'admin_head', 'alm_admin_vars' );
7
+ add_action( 'wp_ajax_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
8
+ add_action( 'wp_ajax_nopriv_alm_save_repeater', 'alm_save_repeater' ); // Ajax Save Repeater
9
+
10
+ /*
11
+ * alm_admin_vars
12
+ * Create admin variables and ajax nonce
13
+ *
14
+ * @since 2.0.0
15
+ */
16
+ function alm_admin_vars() { ?>
17
+ <script type='text/javascript'>
18
+ /* <![CDATA[ */
19
+ var alm_admin_localize = <?php echo json_encode( array(
20
+ 'ajax_admin_url' => admin_url( 'admin-ajax.php' ),
21
+ 'alm_admin_nonce' => wp_create_nonce( 'alm_repeater_nonce' )
22
+ )); ?>
23
+ /* ]]> */
24
+ </script>
25
+ <?php }
26
+
27
+
28
+
29
+ /**
30
+ * alm_update_default
31
+ * Update default repeater if plugin versions do not match. This means the plugin has been updated.
32
+ *
33
+ * @since 2.0.0
34
+ */
35
+
36
+ add_action( 'admin_init', 'alm_update_default' );
37
+ function alm_update_default() {
38
+ global $wpdb;
39
+ $table_name = $wpdb->prefix . "alm";
40
+
41
+ //If alm table is present
42
+ if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) {
43
+ $version = $wpdb->get_var("SELECT pluginVersion FROM $table_name WHERE id = 1");
44
+
45
+ if($version != ALM_VERSION){
46
+ //Write to repeater file
47
+ $defaultRepeater = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE id = 1");
48
+ $f = ALM_PATH. '/core/repeater/default.php'; // File
49
+ $o = fopen($f, 'w+'); //Open file
50
+ $w = fwrite($o, $defaultRepeater); //Save the file
51
+ $r = fread($o, 100000); //Read it
52
+ fclose($o); //now close it
53
+ }
54
+ }
55
+
56
+
57
+ }
58
+ /**
59
+ * alm_admin_menu
60
+ * Create Admin Menu
61
+ *
62
+ * @since 2.0.0
63
+ */
64
+
65
+ add_action( 'admin_menu', 'alm_admin_menu' );
66
+ function alm_admin_menu() {
67
+ $icon = 'dashicons-plus-alt';
68
+ $icon = ALM_ADMIN_URL . "/img/alm-logo-16x16.png";
69
+ add_menu_page( 'Ajax Load More', 'Ajax Load More', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page', $icon, 81 );
70
+ add_submenu_page( 'ajax-load-more', 'Settings', 'Settings', 'edit_theme_options', 'ajax-load-more', 'alm_settings_page');
71
+ add_submenu_page( 'ajax-load-more', 'Repeaters', 'Repeaters', 'edit_theme_options', 'ajax-load-more-repeaters', 'alm_repeater_page');
72
+ add_submenu_page( 'ajax-load-more', 'Shortcode Builder', 'Shortcode Builder', 'edit_theme_options', 'ajax-load-more-shortcode-builder', 'alm_shortcode_builder_page');
73
+ add_submenu_page( 'ajax-load-more', 'Examples', 'Examples', 'edit_theme_options', 'ajax-load-more-examples', 'alm_example_page');
74
+ add_submenu_page( 'ajax-load-more', 'Add-ons', 'Add-ons', 'edit_theme_options', 'ajax-load-more-add-ons', 'alm_add_ons_page');
75
+ }
76
+
77
+
78
+
79
+ /*
80
+ * alm_settings_page
81
+ * Settings page
82
+ *
83
+ * @since 2.0.0
84
+ */
85
+
86
+ function alm_settings_page(){ ?>
87
+ <div class="admin ajax-load-more settings" id="alm-settings">
88
+ <div class="wrap">
89
+ <div class="header-wrap">
90
+ <h2><?php echo ALM_TITLE; ?> <span><?php echo ALM_VERSION; ?></span></h2>
91
+ <p>A simple solution for lazy loading WordPress posts and pages</p>
92
+ </div>
93
+ <div class="alm-main">
94
+ <section class="group">
95
+ <form action="options.php" method="post">
96
+ <?php
97
+ settings_fields( 'alm-setting-group' );
98
+ do_settings_sections( 'ajax-load-more' );
99
+ //get the older values, wont work the first time
100
+ $options = get_option( '_alm_settings' ); ?>
101
+ <div class="row">
102
+ <?php submit_button('Save Settings'); ?>
103
+ </div>
104
+ </form>
105
+ </section>
106
+ </div>
107
+ <aside class="alm-sidebar">
108
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/resources.php'); ?>
109
+ <?php //include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
110
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/about.php'); ?>
111
+ </aside>
112
+
113
+ </div>
114
+ </div>
115
+ <?php
116
+ }
117
+
118
+
119
+
120
+ /*
121
+ * alm_repeater_page
122
+ * Custom Repeaters
123
+ *
124
+ * @since 2.0.0
125
+ */
126
+
127
+ function alm_repeater_page(){ ?>
128
+ <div class="admin ajax-load-more" id="alm-repeaters">
129
+ <div class="wrap">
130
+ <div class="header-wrap">
131
+ <h2><?php _e('Ajax load More: Repeaters', ALM_NAME); ?></h2>
132
+ <p><?php _e('The library of available repeaters', ALM_NAME); ?></p>
133
+ </div>
134
+ <div class="alm-main form-table repeaters">
135
+ <!-- Repeaters -->
136
+ <section class="group">
137
+ <!-- Default -->
138
+ <div class="row default-repeater">
139
+ <?php
140
+ $filename = ALM_PATH. 'core/repeater/default.php';
141
+ $handle = fopen ($filename, "r");
142
+ $contents = fread ($handle, filesize ($filename));
143
+ fclose ($handle);
144
+ ?>
145
+ <h3 class="heading"><?php _e('Default Repeater', ALM_NAME); ?></h3>
146
+ <div class="expand-wrap">
147
+ <div class="section-title">
148
+ <p><?php _e('Enter the HTML and PHP for the default repeater.', ALM_NAME); ?></p>
149
+ </div>
150
+ <div class="wrap repeater-wrap" data-name="default">
151
+ <div class="textarea-wrap">
152
+ <textarea rows="10" class="_alm_repeater"><?php echo $contents; ?></textarea>
153
+ </div>
154
+ <input type="submit" value="Save Repeater" class="button button-primary save-repeater">
155
+ <div class="saved-response">&nbsp;</div>
156
+ <!-- <div class="restore-default"><a href="javascript:void(0);"><?php _e('Restore Default', ALM_NAME); ?></a></div> -->
157
+ </div>
158
+ </div>
159
+ <?php
160
+ if (!has_action('alm_get_custom_repeaters')) {
161
+ echo '<div class="row">';
162
+ include( ALM_PATH. 'admin/includes/cta/extend.php');
163
+ echo '</div>';
164
+ }
165
+ ?>
166
+ <div class="clear"></div>
167
+ </div>
168
+ <!-- End Default -->
169
+ <?php
170
+ if (has_action('alm_custom_repeaters'))
171
+ do_action('alm_custom_repeaters');
172
+ ?>
173
+ <script>
174
+ $(document).ready(function() {
175
+ "use strict";
176
+ $(document).ready(function() {
177
+ var _alm_admin = {};
178
+
179
+ /*
180
+ * _alm_admin.saveRepeater
181
+ * Save Custom Repeater Value
182
+ *
183
+ * @since 2.0.0
184
+ */
185
+
186
+ _alm_admin.saveRepeater = function(btn) {
187
+ var container = btn.parent('.repeater-wrap'),
188
+ el = $('textarea._alm_repeater', container),
189
+ value = el.val(),
190
+ btn = btn,
191
+ repeater = container.data('name'),
192
+ responseText = $(".saved-response", container);
193
+
194
+ //If submit button has changed class.
195
+ if (btn.hasClass('changed')) { // If repeater value has changed.
196
+ responseText.addClass('loading').html('<?php _e('Saving data...', ALM_NAME) ?>');
197
+ $.ajax({
198
+ type: 'POST',
199
+ url: alm_admin_localize.ajax_admin_url,
200
+ data: {
201
+ action: 'alm_save_repeater',
202
+ value: value,
203
+ repeater: repeater,
204
+ nonce: alm_admin_localize.alm_admin_nonce,
205
+ },
206
+ success: function(e) {
207
+ setTimeout(function(){
208
+ responseText.html('<?php _e('Custom repeater value saved.', ALM_NAME) ?>').removeClass('loading').addClass('saved');
209
+ setTimeout(function() {
210
+ responseText.html('&nbsp;').removeClass('saved');
211
+ }, 3000);
212
+ },1000);
213
+ btn.removeClass('changed');
214
+ },
215
+ error: function(xhr, status, error) {
216
+ responseText.html('<?php _e('Something went wrong and the data could not be saved.', ALM_NAME) ?>').removeClass('loading').removeClass('saved');
217
+ btn.removeClass('changed');
218
+ }
219
+ });
220
+ }
221
+ }
222
+ $('input.save-repeater').each(function(){
223
+ $(this).click(function() {
224
+ var btn = $(this);
225
+ btn.addClass('changed');
226
+ _alm_admin.saveRepeater(btn);
227
+ });
228
+ });
229
+ });
230
+ });
231
+ </script>
232
+ </section>
233
+ <!-- End Repeaters -->
234
+ </div>
235
+ <aside class="alm-sidebar">
236
+ <div class="cta">
237
+ <h3><?php _e('Repeater Help', ALM_NAME); ?></h3>
238
+ <?php
239
+ global $wpdb;
240
+
241
+ //$table_name = $wpdb->prefix . "alm";
242
+ //$value = $wpdb->get_var("SELECT repeaterDefault FROM $table_name WHERE id = 1");
243
+
244
+ ?>
245
+ <div class="item">
246
+ <p><strong><?php _e('What is a repeater?', ALM_NAME); ?></strong></p>
247
+ <p><?php _e('A repeater is a snippet of code that will execute over and over within a <a href="http://codex.wordpress.org/The_Loop" target="_blank">WordPress loop</a>.</p>', ALM_NAME); ?></p>
248
+ </div>
249
+ <div class="item">
250
+ <p><strong><?php _e('Can I include PHP in the repeater?', ALM_NAME); ?></strong></p>
251
+ <p><?php _e('Yes, PHP and core WordPress functions such as, <code>the_title()</code> and <code>the_permalink()</code> are required.</p>', ALM_NAME); ?></p>
252
+ </div>
253
+ <div class="item">
254
+ <p><strong><?php _e('Tips and Tricks', ALM_NAME); ?></strong></p>
255
+ <ul>
256
+ <li><?php _e('Always open and close your repeater 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>
257
+ </ul>
258
+ </div>
259
+ </div>
260
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
261
+ </aside>
262
+ </div>
263
+ </div>
264
+
265
+ <?php
266
+ }
267
+
268
+
269
+ /*
270
+ * alm_save_repeater
271
+ * Repeater Save function
272
+ *
273
+ * @since 2.0.0
274
+ */
275
+
276
+ function alm_save_repeater(){
277
+ $nonce = $_POST["nonce"];
278
+ // Check our nonce, if they don't match then bounce!
279
+ if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
280
+ die('Get Bounced!');
281
+
282
+ //Write to repeater file
283
+ $c = Trim(stripslashes($_POST["value"])); // Repeater Value
284
+ $n = Trim(stripslashes($_POST["repeater"])); // Repeater name
285
+ if($n === 'default')
286
+ $f = ALM_PATH. '/core/repeater/'.$n .'.php'; // File
287
+ else
288
+ $f = ALM_REPEATER_PATH. '/repeaters/'.$n .'.php'; // File
289
+ $o = fopen($f, 'w+'); //Open file
290
+ $w = fwrite($o, $c); //Save the file
291
+ $r = fread($o, 100000); //Read it
292
+ fclose($o); //now close it
293
+
294
+
295
+ //Save to database
296
+ global $wpdb;
297
+ $table_name = $wpdb->prefix . "alm";
298
+ $data_update = array('repeaterDefault' => "$c", 'pluginVersion' => ALM_VERSION);
299
+ $data_where = array('id' => "1");
300
+ $wpdb->update($table_name , $data_update, $data_where);
301
+
302
+ //Our results
303
+ if($w){
304
+ echo 'File saved';
305
+ } else {
306
+ echo 'Error saving file';
307
+ }
308
+ }
309
+
310
+
311
+ /*
312
+ * alm_shortcode_builder_page
313
+ * Shortcode Builder
314
+ *
315
+ * @since 2.0.0
316
+ */
317
+
318
+ function alm_shortcode_builder_page(){ ?>
319
+ <div class="admin ajax-load-more" id="alm-builder">
320
+ <div class="wrap">
321
+ <div class="header-wrap">
322
+ <h2><?php _e('Ajax load More: Shortcode Builder', ALM_NAME); ?></h2>
323
+ <p><?php _e('Create your own Ajax Load More <a href="http://en.support.wordpress.com/shortcodes/" target="_blank">shortcode</a> by adjusting the values below', ALM_NAME); ?></p>
324
+ </div>
325
+ <div class="alm-main">
326
+ <section class="group">
327
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/shortcode-builder.php'); ?>
328
+ <div class="row">
329
+ <p class="back2top"><a href="#wpcontent"><i class="fa fa-chevron-up"></i> <?php _e('Back to Top', ALM_NAME); ?></a></p>
330
+ </div>
331
+ </section>
332
+ </div>
333
+ <aside class="alm-sidebar">
334
+ <div class="cta">
335
+ <h3><?php _e('Shortcode Output', ALM_NAME); ?></h3>
336
+ <p><?php _e('Copy and paste the following shortcode into the content editor or widget area of your theme.', ALM_NAME); ?></p>
337
+ <div class="output-wrap">
338
+ <div id="shortcode_output"></div>
339
+ <span class="copy"><?php _e('Copy', ALM_NAME); ?></span>
340
+ </div>
341
+ </div>
342
+ <div class="cta">
343
+ <h3><?php _e('Did you know?', ALM_NAME); ?></h3>
344
+ <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/shortcode-editor.jpg"><br/>
345
+ <?php _e('<p class="addon-intro">You can generate shortcodes while editing pages!</p><p>Look for the Ajax Load More [+] icon in the content editor toolbar and the <a href="?page=ajax-load-more-shortcode-builder">shortcode builder</a> will pop open.', ALM_NAME); ?></p>
346
+ </div>
347
+ </aside>
348
+ </div>
349
+ </div>
350
+ <?php
351
+ }
352
+
353
+
354
+ /*
355
+ * alm_example_page
356
+ * Examples Page
357
+ *
358
+ * @since 2.0.0
359
+ */
360
+
361
+ function alm_example_page(){ ?>
362
+ <div class="admin ajax-load-more" id="alm-examples">
363
+ <div class="wrap">
364
+ <div class="header-wrap">
365
+ <h2><?php _e('Ajax load More: Examples', ALM_NAME); ?></h2>
366
+ <p><?php _e('A collection of everyday shortcode usages and implementation examples', ALM_NAME); ?></p>
367
+ </div>
368
+ <div class="alm-main forceColors">
369
+ <section class="group">
370
+ <div class="row gist">
371
+ <h3 class="heading"><?php _e('Author.php', ALM_NAME); ?></h3>
372
+ <div class="expand-wrap">
373
+ <p><?php _e('Example shortcode for use on author archive pages.', ALM_NAME); ?></p>
374
+ <div class="inner">
375
+ <script src="https://gist.github.com/dcooney/4d07ff95f7274f38fd3a.js"></script>
376
+ </div>
377
+ </div>
378
+ </div>
379
+ <div class="row gist">
380
+ <h3 class="heading"><?php _e('Category.php', ALM_NAME); ?></h3>
381
+ <div class="expand-wrap">
382
+ <p><?php _e('Example shortcode for use on category archive pages.', ALM_NAME); ?></p>
383
+ <div class="inner">
384
+ <script src="https://gist.github.com/dcooney/ae4caec3f9061dd47627.js"></script>
385
+ </div>
386
+ </div>
387
+ </div>
388
+ <div class="row gist">
389
+ <h3 class="heading"><?php _e('Excluding Posts', ALM_NAME); ?></h3>
390
+ <div class="expand-wrap">
391
+ <p><?php _e('Example shortcode for excluding an array of posts.', ALM_NAME); ?></p>
392
+ <script src="https://gist.github.com/dcooney/9b037efbd166b4dba5ae.js"></script>
393
+ </div>
394
+ </div>
395
+
396
+ <div class="row gist">
397
+ <h3 class="heading"><?php _e('Tag.php', ALM_NAME); ?></h3>
398
+ <div class="expand-wrap">
399
+ <p><?php _e('Example shortcode for use on tag archive pages.', ALM_NAME); ?></p>
400
+ <div class="inner">
401
+ <script src="https://gist.github.com/dcooney/fc4276bebbdd05af64d1.js"></script>
402
+ </div>
403
+ </div>
404
+ </div>
405
+ <div class="row">
406
+ <p class="back2top"><a href="#wpcontent"><i class="fa fa-chevron-up"></i> <?php _e('Back to Top', ALM_NAME); ?></a></p>
407
+ </div>
408
+ </section>
409
+ </div>
410
+ <aside class="alm-sidebar">
411
+ <div class="cta">
412
+ <h3><?php _e('Request Examples', ALM_NAME); ?></h3>
413
+ <p><?php _e('If you\'re having issue\'s with functionality, please submit example requests through the <a href="https://github.com/dcooney/wordpress-ajax-load-more" target="_blank">GitHub repository</a>. ', ALM_NAME); ?></p>
414
+ </div>
415
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/about.php'); ?>
416
+ </aside>
417
+
418
+
419
+ </div>
420
+ </div>
421
+ <?php
422
+ }
423
+
424
+
425
+
426
+ /*
427
+ * alm_add_ons_page
428
+ * Ajax Load More Add-ons
429
+ *
430
+ * @since 2.0.0
431
+ */
432
+
433
+ function alm_add_ons_page(){ ?>
434
+ <div class="admin ajax-load-more" id="alm-add-ons">
435
+ <div class="wrap">
436
+ <div class="header-wrap">
437
+ <h2><?php _e('Ajax load More: Add-ons', ALM_NAME); ?></h2>
438
+ <p><?php _e('The following Add-ons are available to increase the functionality of Ajax Load More.', ALM_NAME); ?></p>
439
+ </div>
440
+ <div class="alm-main forceColors">
441
+ <!-- Custom Repeater -->
442
+ <section class="group">
443
+ <div class="row">
444
+ <h3 class="add-on-title"><?php _e('Custom Repeaters', ALM_NAME); ?></h3>
445
+ <div class="expand-wrap">
446
+ <div class="section-title">
447
+ <img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/repeater-add-ons.jpg">
448
+ </div>
449
+ <div class="wrap">
450
+ <p class="addon-intro"><?php _e('Unlock additional repeaters and keep your site looking fresh!', ALM_NAME); ?></p>
451
+ <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>
452
+ <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); ?>
453
+ </div>
454
+ </div>
455
+ </div>
456
+ <?php
457
+ if (has_action('alm_repeater_installed')){
458
+ echo '<a class="btn installed" href="#"><i class="fa fa-check-square"></i> Installed</a> ';
459
+ }else{
460
+ 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>';
461
+ }
462
+ ?>
463
+ </section>
464
+ <!-- End Custom Repeater -->
465
+ </div>
466
+
467
+ <aside class="alm-sidebar">
468
+ <div class="cta">
469
+ <h3><?php _e('About Add-ons', ALM_NAME); ?></h3>
470
+ <p><?php _e('Add-ons are installed as a separate plugin and will receive plug-in update notifications. ', ALM_NAME); ?></p>
471
+ </div>
472
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
473
+ </aside>
474
+
475
+ </div>
476
+ </div>
477
+ <?php
478
+ }
479
+
480
+ /*
481
+ * adminHeader
482
+ * Admin CSS and JS
483
+ *
484
+ * @since 2.0.0
485
+ */
486
+
487
+ add_action('admin_head', 'alm_adminHeader');
488
+ add_action('admin_footer', 'alm_adminFooter');
489
+ function alm_adminHeader() {
490
+ $url = plugins_url( 'css/admin.css', __FILE__ );
491
+ echo '<link rel="stylesheet" type="text/css" href="' . $url . '" />';
492
+ echo '<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">';
493
+ echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>';
494
+ }
495
+ function alm_adminFooter() {
496
+ echo '<script type="text/javascript" src="'.plugins_url( 'js/libs/select2.min.js', __FILE__ ).'"></script>';
497
+ echo '<script type="text/javascript" src="'.plugins_url( 'js/shortcode-builder.js', __FILE__ ).'"></script>';
498
+ }
499
+
500
+
501
+
502
+ /*
503
+ * admin_init
504
+ * Initiate the plugin, create our setting variables.
505
+ *
506
+ * @since 2.0.0
507
+ */
508
+
509
+ add_action( 'admin_init', 'alm_admin_init');
510
+ function alm_admin_init(){
511
+ register_setting(
512
+ 'alm-setting-group',
513
+ 'alm_settings',
514
+ 'alm_sanitize_settings'
515
+ );
516
+ add_settings_section(
517
+ 'alm_general_settings',
518
+ 'General Settings',
519
+ 'alm_general_settings_callback',
520
+ 'ajax-load-more'
521
+ );
522
+ add_settings_field(
523
+ '_alm_disable_css',
524
+ __('Disable CSS', ALM_NAME ),
525
+ 'alm_disable_css_callback',
526
+ 'ajax-load-more',
527
+ 'alm_general_settings'
528
+ );
529
+ add_settings_field(
530
+ '_alm_html5',
531
+ __('HTML5 Elements', ALM_NAME ),
532
+ 'alm_html5_callback',
533
+ 'ajax-load-more',
534
+ 'alm_general_settings'
535
+ );
536
+ add_settings_field(
537
+ '_alm_container_type',
538
+ __('Container Type', ALM_NAME ),
539
+ 'alm_container_type_callback',
540
+ 'ajax-load-more',
541
+ 'alm_general_settings'
542
+ );
543
+ add_settings_field(
544
+ '_alm_classname',
545
+ __('Container Class', ALM_NAME ),
546
+ 'alm_class_callback',
547
+ 'ajax-load-more',
548
+ 'alm_general_settings'
549
+ );
550
+ add_settings_field(
551
+ '_alm_btn_color',
552
+ __('Button Color', ALM_NAME ),
553
+ 'alm_btn_color_callback',
554
+ 'ajax-load-more',
555
+ 'alm_general_settings'
556
+ );
557
+ }
558
+
559
+
560
+
561
+ /*
562
+ * alm_general_settings_callback
563
+ * Some general settings text
564
+ *
565
+ * @since 2.0.0
566
+ */
567
+
568
+ function alm_general_settings_callback() {
569
+ echo '<p>' . __('Customize your version of Ajax Load More by updating the fields below.</p><p class="small">All changes will be applied globally accross your theme.', ALM_NAME) . '</p>';
570
+ }
571
+
572
+
573
+ /*
574
+ * alm_sanitize_settings
575
+ * Sanitize our form fields
576
+ *
577
+ * @since 2.0.0
578
+ */
579
+
580
+ function alm_sanitize_settings( $input ) {
581
+ return $input;
582
+ }
583
+
584
+
585
+ /*
586
+ * alm_disable_css_callback
587
+ * Diabale Ajax Load More CSS.
588
+ *
589
+ * @since 2.0.0
590
+ */
591
+
592
+ function alm_disable_css_callback(){
593
+ $options = get_option( 'alm_settings' );
594
+ if(!isset($options['_alm_disable_css']))
595
+ $options['_alm_disable_css'] = '0';
596
+
597
+ echo '<input type="hidden" name="alm_settings[_alm_disable_css]" value="0" />
598
+ <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>';
599
+ 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>';
600
+ }
601
+
602
+
603
+ /*
604
+ * alm_html5_callback
605
+ * Enable HTML5 elements within AjaxLoadMore.
606
+ *
607
+ * @since 2.0.0
608
+ */
609
+
610
+ function alm_html5_callback(){
611
+ $options = get_option( 'alm_settings' );
612
+ if(!isset($options['_alm_html5']))
613
+ $options['_alm_html5'] = '1';
614
+
615
+ echo '<input type="hidden" name="alm_settings[_alm_html5]" value="0" />
616
+ <label><input type="checkbox" name="alm_settings[_alm_html5]" value="1"'. (($options['_alm_html5']) ? ' checked="checked"' : '') .' /> Enable HTML5 elements within Ajax Load More\'s output.</label>';
617
+ }
618
+
619
+
620
+ /*
621
+ * alm_class_callback
622
+ * Enable HTML5 elements within AjaxLoadMore.
623
+ *
624
+ * @since 2.0.0
625
+ */
626
+
627
+ function alm_class_callback(){
628
+ $options = get_option( 'alm_settings' );
629
+
630
+ echo '<label for="alm_settings[_alm_classname]">Add classes to Ajax Load More container.</label><br/><input type="text" id="alm_settings[_alm_classname]" name="alm_settings[_alm_classname]" value="'.$options['_alm_classname'].'" /> ';
631
+ }
632
+
633
+
634
+ /*
635
+ * alm_container_type_callback
636
+ * The type of container ul or div
637
+ *
638
+ * @since 2.0.0
639
+ */
640
+
641
+ function alm_container_type_callback() {
642
+
643
+ $options = get_option( 'alm_settings' );
644
+
645
+ if(!isset($options['_alm_container_type']))
646
+ $options['_alm_container_type'] = '1';
647
+
648
+ $html = '<input type="radio" id="_alm_container_type_one" name="alm_settings[_alm_container_type]" value="1"' . checked( 1, $options['_alm_container_type'], false ) . '/>';
649
+ $html .= '<label for="_alm_container_type_one">&lt;ul&gt; <span>&lt;!-- Ajax Posts Here --&gt;</span> &lt;/ul&gt;</label><br/>';
650
+
651
+ $html .= '<input type="radio" id="_alm_container_type_two" name="alm_settings[_alm_container_type]" value="2"' . checked( 2, $options['_alm_container_type'], false ) . '/>';
652
+ $html .= '<label for="_alm_container_type_two">&lt;div&gt; <span>&lt;!-- Ajax Posts Here --&gt;</span> &lt;/div&gt;</label>';
653
+
654
+ echo $html;
655
+
656
+ }
657
+
658
+
659
+
660
+ /*
661
+ * alm_btn_color_callback
662
+ * Get button color
663
+ *
664
+ * @since 2.0.0
665
+ */
666
+
667
+ function alm_btn_color_callback() {
668
+
669
+ $options = get_option( 'alm_settings' );
670
+ $color = $options['_alm_btn_color'];
671
+
672
+ if(!isset($color))
673
+ $options['_alm_btn_color'] = '0';
674
+
675
+ $selected0 = '';
676
+ if($color == 'default')
677
+ $selected0 = 'selected="selected"';
678
+
679
+ $selected1 = '';
680
+ if($color == 'blue')
681
+ $selected1 = 'selected="selected"';
682
+
683
+ $selected2 = '';
684
+ if($color == 'green')
685
+ $selected2 = 'selected="selected"';
686
+
687
+ $selected3 = '';
688
+ if($color == 'red')
689
+ $selected3 = 'selected="selected"';
690
+
691
+ $selected4 = '';
692
+ if($color == 'purple')
693
+ $selected4 = 'selected="selected"';
694
+
695
+ $selected5 = '';
696
+ if($color == 'grey')
697
+ $selected5 = 'selected="selected"';
698
+
699
+
700
+ $html = '<select id="name="alm_settings[_alm_btn_color]" name="alm_settings[_alm_btn_color]">';
701
+ $html .= '<option value="default" ' . $selected0 .'>Default (Orange)</option>';
702
+ $html .= '<option value="blue" ' . $selected1 .'>Blue</option>';
703
+ $html .= '<option value="green" ' . $selected2 .'>Green</option>';
704
+ $html .= '<option value="red" ' . $selected3 .'>Red</option>';
705
+ $html .= '<option value="purple" ' . $selected4 .'>Purple</option>';
706
+ $html .= '<option value="grey" ' . $selected5 .'>Grey</option>';
707
+ $html .= '</select>';
708
+
709
+ echo $html;
710
+
711
+ }
712
+
713
+
admin/css/admin.css ADDED
@@ -0,0 +1,1098 @@