Carousel Slider - Version 1.4.1

Version Description

Upgrade the plugin to get more features and better performance.

Download this release

Release Info

Developer sayful
Plugin Icon Carousel Slider
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.3 to 1.4.1

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.
admin/Carousel_Slider_Admin.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Carousel_Slider_Admin {
4
+
5
+ private $plugin_name;
6
+
7
+ private $version;
8
+
9
+ public function __construct( $plugin_name, $version ) {
10
+
11
+ $this->plugin_name = $plugin_name;
12
+ $this->version = $version;
13
+
14
+ }
15
+
16
+ public function mce_plugin($plugin_array) {
17
+ $plugin_array['carousel_slider'] = plugin_dir_url( __FILE__ ) . 'js/carousel-button.js';
18
+ return $plugin_array;
19
+ }
20
+
21
+ public function mce_button($buttons) {
22
+ array_push ($buttons, 'carousel_slider_button');
23
+ return $buttons;
24
+ }
25
+
26
+ public function carousel_admin_color( $hook_suffix ) {
27
+ wp_enqueue_style( 'wp-color-picker' );
28
+ wp_enqueue_script( $this->plugin_name.'color', plugin_dir_url( __FILE__ ) . 'js/carousel-color-script.js', array( 'wp-color-picker' ), false, true );
29
+ }
30
+
31
+ public function carousel_post_type() {
32
+
33
+ $labels = array(
34
+ 'name' => _x( 'Carousels', 'Post Type General Name', 'carouselslider' ),
35
+ 'singular_name' => _x( 'Carousel', 'Post Type Singular Name', 'carouselslider' ),
36
+ 'menu_name' => __( 'Carousels', 'carouselslider' ),
37
+ 'parent_item_colon' => __( 'Parent Carousel:', 'carouselslider' ),
38
+ 'all_items' => __( 'All Carousels', 'carouselslider' ),
39
+ 'view_item' => __( 'View Carousel', 'carouselslider' ),
40
+ 'add_new_item' => __( 'Add New Carousel', 'carouselslider' ),
41
+ 'add_new' => __( 'Add New', 'carouselslider' ),
42
+ 'edit_item' => __( 'Edit Carousel', 'carouselslider' ),
43
+ 'update_item' => __( 'Update Carousel', 'carouselslider' ),
44
+ 'search_items' => __( 'Search Carousel', 'carouselslider' ),
45
+ 'not_found' => __( 'Not found', 'carouselslider' ),
46
+ 'not_found_in_trash' => __( 'Not found in Trash', 'carouselslider' ),
47
+ );
48
+ $args = array(
49
+ 'label' => __( 'Carousel', 'carouselslider' ),
50
+ 'description' => __( 'Carousel', 'carouselslider' ),
51
+ 'labels' => $labels,
52
+ 'supports' => array( 'title', 'editor', 'thumbnail', ),
53
+ 'hierarchical' => false,
54
+ 'public' => true,
55
+ 'show_ui' => true,
56
+ 'show_in_menu' => true,
57
+ 'show_in_nav_menus' => true,
58
+ 'show_in_admin_bar' => true,
59
+ 'menu_position' => 5,
60
+ 'menu_icon' => 'dashicons-slides',
61
+ 'can_export' => true,
62
+ 'has_archive' => true,
63
+ 'exclude_from_search' => false,
64
+ 'publicly_queryable' => true,
65
+ 'rewrite' => false,
66
+ 'capability_type' => 'post',
67
+ );
68
+ register_post_type( 'carousel', $args );
69
+
70
+ }
71
+
72
+ public function custom_image_size(){
73
+ $this->options = get_option('sis_carousel_settings');
74
+
75
+ if ( isset($this->options['image_size']) && $this->options['image_size'] == 'carousel-thumb') {
76
+
77
+ if (isset($this->options['img_crop']) && $this->options['img_crop'] == 'false') {
78
+
79
+ add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'] );
80
+
81
+ } else {
82
+ add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'], true );
83
+ }
84
+
85
+ }
86
+ }
87
+
88
+ public function carousel_image_box() {
89
+ remove_meta_box( 'postimagediv', 'carousel', 'side' );
90
+ add_meta_box('postimagediv', __('Upload Carousel Image', 'carouselslider'), 'post_thumbnail_meta_box', 'carousel', 'normal', 'high');
91
+ }
92
+ // Register Custom Taxonomy
93
+ public function custom_taxonomy() {
94
+
95
+ $labels = array(
96
+ 'name' => _x( 'Carousel Categories', 'Taxonomy General Name', 'carouselslider' ),
97
+ 'singular_name' => _x( 'Carousel Category', 'Taxonomy Singular Name', 'carouselslider' ),
98
+ 'menu_name' => __( 'Carousel Categories', 'carouselslider' ),
99
+ 'all_items' => __( 'All Carousel Categories', 'carouselslider' ),
100
+ 'parent_item' => __( 'Parent Carousel Category', 'carouselslider' ),
101
+ 'parent_item_colon' => __( 'Parent Carousel Category:', 'carouselslider' ),
102
+ 'new_item_name' => __( 'New Carousel Category Name', 'carouselslider' ),
103
+ 'add_new_item' => __( 'Add New Carousel Category', 'carouselslider' ),
104
+ 'edit_item' => __( 'Edit Carousel Category', 'carouselslider' ),
105
+ 'update_item' => __( 'Update Carousel Category', 'carouselslider' ),
106
+ 'separate_items_with_commas' => __( 'Separate Carousel Categories with commas', 'carouselslider' ),
107
+ 'search_items' => __( 'Search Carousel Categories', 'carouselslider' ),
108
+ 'add_or_remove_items' => __( 'Add or remove Carousel Categories', 'carouselslider' ),
109
+ 'choose_from_most_used' => __( 'Choose from the most used Carousel Categories', 'carouselslider' ),
110
+ 'not_found' => __( 'Not Found', 'carouselslider' ),
111
+ );
112
+ $args = array(
113
+ 'labels' => $labels,
114
+ 'hierarchical' => false,
115
+ 'public' => true,
116
+ 'show_ui' => true,
117
+ 'show_admin_column' => true,
118
+ 'show_in_nav_menus' => true,
119
+ 'show_tagcloud' => true,
120
+ 'rewrite' => array( 'slug' => 'carousel-category', ),
121
+ );
122
+ register_taxonomy( 'carousel_category', array( 'carousel' ), $args );
123
+
124
+ }
125
+ public function add_meta_box() {
126
+ add_meta_box(
127
+ 'carousel_slider_id',
128
+ __( 'Carousel Meta Box','carouselslider' ),
129
+ array( $this, 'carousel_slider_meta_box_callback' ),
130
+ 'carousel'
131
+ );
132
+ }
133
+ public function save_meta_box( $post_id ) {
134
+
135
+ /*
136
+ * We need to verify this came from the our screen and with proper authorization,
137
+ * because save_post can be triggered at other times.
138
+ */
139
+
140
+ // Check if our nonce is set.
141
+ if ( ! isset( $_POST['carousel_slider_meta_box_nonce'] ) )
142
+ return $post_id;
143
+
144
+ $nonce = $_POST['carousel_slider_meta_box_nonce'];
145
+
146
+ // Verify that the nonce is valid.
147
+ if ( ! wp_verify_nonce( $nonce, 'carousel_slider_inner_custom_box' ) )
148
+ return $post_id;
149
+
150
+ // If this is an autosave, our form has not been submitted,
151
+ // so we don't want to do anything.
152
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
153
+ return $post_id;
154
+
155
+ // Check the user's permissions.
156
+ if ( 'page' == $_POST['post_type'] ) {
157
+
158
+ if ( ! current_user_can( 'edit_page', $post_id ) )
159
+ return $post_id;
160
+
161
+ } else {
162
+
163
+ if ( ! current_user_can( 'edit_post', $post_id ) )
164
+ return $post_id;
165
+ }
166
+
167
+ /* OK, its safe for us to save the data now. */
168
+
169
+ // Sanitize the user input.
170
+ $link_target = sanitize_text_field( $_POST['carousel_slider_slide_link_target'] );
171
+
172
+ if ((trim($_POST['carousel_slider_slide_link'])) != '') {
173
+
174
+ $carousel_link = esc_url( $_POST['carousel_slider_slide_link'] );
175
+
176
+ } else {
177
+ $carousel_link = esc_url(get_permalink());
178
+ }
179
+
180
+
181
+
182
+ // Update the meta field.
183
+ update_post_meta( $post_id, '_carousel_slider_slide_link_value', $carousel_link );
184
+ update_post_meta( $post_id, '_carousel_slider_slide_link_target_value', $link_target );
185
+ }
186
+ public function carousel_slider_meta_box_callback( $post ) {
187
+
188
+ // Add an nonce field so we can check for it later.
189
+ wp_nonce_field( 'carousel_slider_inner_custom_box', 'carousel_slider_meta_box_nonce' );
190
+
191
+ // Use get_post_meta to retrieve an existing value from the database.
192
+ $carousel_link = get_post_meta( $post->ID, '_carousel_slider_slide_link_value', true );
193
+ $link_target = get_post_meta( $post->ID, '_carousel_slider_slide_link_target_value', true );
194
+
195
+ ?>
196
+ <table class="form-table">
197
+ <tr valign="top">
198
+ <th scope="row">
199
+ <label for="carousel_slider_slide_link">
200
+ <?php _e('Carousel Link','nivo-image-slider') ?>
201
+ </label>
202
+ </th>
203
+ <td>
204
+ <input type="text" class="regular-text" id="carousel_slider_slide_link" name="carousel_slider_slide_link" value="<?php echo esc_attr( $carousel_link ); ?>" style="width:100% !important">
205
+ <p><?php _e('Write slide link URL. If you want to use current slide link, just leave it blank. If you do not want any link write (#) without bracket or write desired link..','nivo-image-slider'); ?></p>
206
+ </td>
207
+ </tr>
208
+ <tr valign="top">
209
+ <th scope="row">
210
+ <label for="carousel_slider_slide_link_target">
211
+ <?php _e('Carousel Link Target','nivo-image-slider') ?>
212
+ </label>
213
+ </th>
214
+ <td>
215
+ <select name="carousel_slider_slide_link_target">
216
+ <option value="_self" <?php selected( $link_target, '_self' ); ?>>Self</option>
217
+ <option value="_blank" <?php selected( $link_target, '_blank' ); ?>>Blank</option>
218
+ </select>
219
+ <p><?php _e('Select Self to open the slide in the same frame as it was clicked (this is default) or select Blank open the slide in a new window or tab.','nivo-image-slider'); ?></p>
220
+ </td>
221
+ </tr>
222
+ </table>
223
+ <?php
224
+ }
225
+
226
+ }
admin/Carousel_Slider_Settings.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Carousel_Slider_Settings {
3
+ /**
4
+ * Holds the values to be used in the fields callbacks
5
+ */
6
+ private $options;
7
+
8
+ /**
9
+ * Start up
10
+ */
11
+ public function __construct()
12
+ {
13
+ add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
14
+ add_action( 'admin_init', array( $this, 'page_init' ) );
15
+ register_activation_hook( __FILE__, array( $this, 'default_options' ));
16
+ $this->options = get_option('sis_carousel_settings');
17
+
18
+
19
+ }
20
+
21
+ public function default_options(){
22
+
23
+ $options_array = array(
24
+ 'image_size' => 'full',
25
+ 'img_width' => '',
26
+ 'img_height' => '',
27
+ 'img_crop' => '',
28
+ 'btn_bg_color' => '#666666',
29
+ 'btn_color' => '#dddddd',
30
+ 'btn_opacity' => '0.4',
31
+ );
32
+
33
+ if ( $this->options !== false ) {
34
+
35
+ update_option( 'sis_carousel_settings', $options_array );
36
+
37
+ } else{
38
+
39
+ add_option( 'sis_carousel_settings', $options_array );
40
+
41
+ }
42
+
43
+ }
44
+
45
+ public function custom_image_size(){
46
+
47
+ if ( isset($options['image_size']) && $options['image_size'] == 'carousel-thumb') {
48
+
49
+ add_image_size( 'carousel-thumb', $this->options['img_width'], $this->options['img_height'], $this->options['img_crop'] );
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Add options page
55
+ */
56
+ public function add_plugin_page()
57
+ {
58
+ // This page will be under "Settings"
59
+ add_options_page(
60
+ __('Carousel Slider Settings', 'carouselslider'),
61
+ __('Carousel Slider', 'carouselslider'),
62
+ 'manage_options',
63
+ 'carousel_slider',
64
+ array( $this, 'create_admin_page' )
65
+ );
66
+ }
67
+
68
+ /**
69
+ * Options page callback
70
+ */
71
+ public function create_admin_page()
72
+ {
73
+ // Set class property
74
+ $this->options = get_option( 'sis_carousel_settings' );
75
+ ?>
76
+ <div class="wrap">
77
+ <h2><?php _e('Carousel Slider Settings' ,'carouselslider'); ?></h2>
78
+ <form method="post" action="options.php">
79
+ <?php
80
+ // This prints out all hidden setting fields
81
+ settings_fields( 'carousel_slider_option_group' );
82
+ do_settings_sections( 'carousel_slider' );
83
+ submit_button();
84
+ ?>
85
+ </form>
86
+ </div>
87
+ <?php
88
+ }
89
+
90
+ /**
91
+ * Register and add settings
92
+ */
93
+ public function page_init() {
94
+
95
+ register_setting(
96
+ 'carousel_slider_option_group', // Option group
97
+ 'sis_carousel_settings', // Option name
98
+ array( $this, 'sanitize' ) // Sanitize
99
+ );
100
+
101
+ add_settings_section(
102
+ 'setting_section_id', // ID
103
+ __('Global Settings', 'carouselslider'), // Title
104
+ array( $this, 'print_section_info' ), // Callback
105
+ 'carousel_slider' // Page
106
+ );
107
+
108
+ add_settings_field(
109
+ 'image_size', // ID
110
+ __('Carousel Images Size', 'carouselslider'), // Title
111
+ array( $this, 'image_size_callback' ), // Callback
112
+ 'carousel_slider', // Page
113
+ 'setting_section_id' // Section
114
+ );
115
+
116
+ add_settings_field(
117
+ 'custom_image_size',
118
+ __('Custom Image Size', 'carouselslider'),
119
+ array( $this, 'custom_image_size_callback' ),
120
+ 'carousel_slider',
121
+ 'setting_section_id'
122
+ );
123
+
124
+ add_settings_field(
125
+ 'btn_bg_color',
126
+ __('Nav Background Color', 'carouselslider'),
127
+ array( $this, 'btn_bg_color_callback' ),
128
+ 'carousel_slider',
129
+ 'setting_section_id'
130
+ );
131
+
132
+ add_settings_field(
133
+ 'btn_color',
134
+ __('Nav Color', 'carouselslider'),
135
+ array( $this, 'btn_color_callback' ),
136
+ 'carousel_slider',
137
+ 'setting_section_id'
138
+ );
139
+
140
+ add_settings_field(
141
+ 'btn_opacity',
142
+ __('Nav Opacity', 'carouselslider'),
143
+ array( $this, 'btn_opacity_callback' ),
144
+ 'carousel_slider',
145
+ 'setting_section_id'
146
+ );
147
+ }
148
+
149
+ /**
150
+ * Sanitize each setting field as needed
151
+ *
152
+ * @param array $input Contains all settings fields as array keys
153
+ */
154
+ public function sanitize( $input )
155
+ {
156
+ $new_input = array();
157
+
158
+ if ( in_array( $input['image_size'], array( 'thumbnail', 'medium', 'large', 'full', 'carousel-thumb' ), true ) )
159
+ $new_input['image_size'] = $input['image_size'];
160
+
161
+ if( isset( $input['img_width'] ) )
162
+ $new_input['img_width'] = absint( $input['img_width'] );
163
+
164
+ if( isset( $input['img_height'] ) )
165
+ $new_input['img_height'] = absint( $input['img_height'] );
166
+
167
+ if ( in_array( $input['img_crop'], array( 'false', 'true' ), true ) )
168
+ $new_input['img_crop'] = $input['img_crop'];
169
+
170
+ if( isset( $input['btn_bg_color'] ) )
171
+ $new_input['btn_bg_color'] = sanitize_text_field( $input['btn_bg_color'] );
172
+
173
+ if( isset( $input['btn_color'] ) )
174
+ $new_input['btn_color'] = sanitize_text_field( $input['btn_color'] );
175
+
176
+ if( isset( $input['btn_opacity'] ) )
177
+ $new_input['btn_opacity'] = sanitize_text_field( $input['btn_opacity'] );
178
+
179
+ return $new_input;
180
+ }
181
+
182
+ /**
183
+ * Print the Section text
184
+ */
185
+ public function print_section_info()
186
+ {
187
+ print 'Change the global settings for carousel slider. This settings will be applicable for all carousel slider that you used in your site.';
188
+ }
189
+
190
+ /**
191
+ * Get the settings option array and print one of its values
192
+ */
193
+ function image_size_callback() {
194
+
195
+ $values = array(
196
+ 'full' => 'Full resolution (original size uploaded)',
197
+ 'large' => 'Large resolution (default 640px x 640px max)',
198
+ 'medium' => 'Medium resolution (default 300px x 300px max)',
199
+ 'thumbnail' => 'Thumbnail (default 150px x 150px max)',
200
+ 'carousel-thumb'=> 'Use custom image size',
201
+ );
202
+
203
+ ?>
204
+ <select id='image_size' name='sis_carousel_settings[image_size]'>
205
+ <?php
206
+ foreach($values as $code => $label) :
207
+ if( $code == $this->options['image_size'] ) { $selected = "selected='selected'"; } else { $selected = ''; }
208
+ echo "<option {$selected} value='{$code}'>{$label}</option>";
209
+ endforeach;
210
+ ?>
211
+ </select>
212
+ <?php
213
+ echo '<p>' . __( 'Select carousel image size.', 'sandbox' ) . '</p>';
214
+ }
215
+ /**
216
+ * Get the settings option array and print one of its values
217
+ */
218
+ public function custom_image_size_callback() {
219
+
220
+ $values = array(
221
+ 'false' => 'Soft proportional crop mode',
222
+ 'true' => 'Hard crop mode',
223
+ );
224
+
225
+ ?>
226
+ <input type='number' class='small-text' name='sis_carousel_settings[img_width]' id='img_width' value='<?php echo (isset($this->options['img_width'])) ? $this->options['img_width'] : '0'; ?>'>
227
+
228
+ <input type='number' class='small-text' name='sis_carousel_settings[img_height]' id='img_height' value='<?php echo (isset($this->options['img_height'])) ? $this->options['img_height'] : '0'; ?>'>
229
+ <select id='img_crop' name='sis_carousel_settings[img_crop]'>
230
+ <?php
231
+ foreach($values as $code => $label) :
232
+ if( $code == $this->options['img_crop'] ) { $selected = "selected='selected'"; } else { $selected = ''; }
233
+ echo "<option {$selected} value='{$code}'>{$label}</option>";
234
+ endforeach;
235
+ ?>
236
+ </select>
237
+ <p><?php _e( 'Width x Height x Crop. (Carousel Images Size need to be selected as Use custom image size). This settings will not affect for the previously uploaded images. If you want to rebuild previously uploaded images, you can use another WordPress plugin <a target="_blank" href="https://wordpress.org/plugins/ajax-thumbnail-rebuild/">AJAX Thumbnail Rebuild</a>', 'sandbox' ); ?></p>
238
+ <?php
239
+
240
+ }
241
+
242
+ public function btn_bg_color_callback(){
243
+ ?>
244
+ <input type="text" name="sis_carousel_settings[btn_bg_color]" id="btn_bg_color" data-default-color="#666666" value="<?php echo (isset($this->options['btn_bg_color'])) ? $this->options['btn_bg_color'] : '#666666'; ?>">
245
+ <p><?php _e( 'Choose carousel navigation background color.', 'sandbox' ); ?></p>
246
+ <?php
247
+ }
248
+
249
+ public function btn_color_callback(){
250
+ ?>
251
+ <input type="text" name="sis_carousel_settings[btn_color]" id="btn_color" data-default-color="#dddddd" value="<?php echo (isset($this->options['btn_color'])) ? $this->options['btn_color'] : '#dddddd'; ?>">
252
+ <p><?php _e( 'Choose carousel navigation color.', 'sandbox' ); ?></p>
253
+ <?php
254
+ }
255
+
256
+ public function btn_opacity_callback(){
257
+ ?>
258
+ <input type="text" class="small-text" name="sis_carousel_settings[btn_opacity]" id="btn_opacity" value="<?php echo (isset($this->options['btn_opacity'])) ? $this->options['btn_opacity'] : '.4'; ?>">
259
+ <p><?php _e( 'Enter button opacity value. min value is 0 and max value is 1. Example 0.2', 'sandbox' ); ?></p>
260
+ <?php
261
+ }
262
+ }
263
+
264
+ if( is_admin() )
265
+ $carousel_slider_settings = new Carousel_Slider_Settings();
admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/js/carousel-button.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.Carousel_Slider', {
3
+
4
+ init : function(ed, url) {
5
+ ed.addCommand('carousel_slider_button', function() {
6
+ return_text = '[carousel id=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][item href="" img_link=""][/carousel]';
7
+ ed.execCommand('mceInsertContent', 0, return_text);
8
+ });
9
+
10
+
11
+ ed.addButton('carousel_slider_button', {
12
+ title : 'Add Carousel Slider',
13
+ cmd : 'carousel_slider_button',
14
+ image : url + '/carousel.png'
15
+ });
16
+
17
+ },
18
+ createControl : function(n, cm) {
19
+ return null;
20
+ },
21
+ });
22
+
23
+ // Register plugin
24
+ tinymce.PluginManager.add('carousel_slider', tinymce.plugins.Carousel_Slider);
25
+ })();
admin/js/carousel-color-script.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+ $('#btn_bg_color').wpColorPicker();
3
+ $('#btn_color').wpColorPicker();
4
+ });
{js → admin/js}/carousel.png RENAMED
File without changes
admin/partials/plugin-name-admin-display.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Provide a dashboard view for the plugin
5
+ *
6
+ * This file is used to markup the public-facing aspects of the plugin.
7
+ *
8
+ * @link http://example.com
9
+ * @since 1.0.0
10
+ *
11
+ * @package Plugin_Name
12
+ * @subpackage Plugin_Name/admin/partials
13
+ */
14
+ ?>
15
+
16
+ <!-- This file should primarily consist of HTML with a little bit of PHP. -->
carousel-img-type.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- // Register Custom Post Type
3
- function sis_carousel_custom_post_type() {
4
-
5
- $labels = array(
6
- 'name' => _x( 'Carousels', 'Post Type General Name', 'carouselslider' ),
7
- 'singular_name' => _x( 'Carousel', 'Post Type Singular Name', 'carouselslider' ),
8
- 'menu_name' => __( 'Carousels', 'carouselslider' ),
9
- 'parent_item_colon' => __( 'Parent Carousel:', 'carouselslider' ),
10
- 'all_items' => __( 'All Carousels', 'carouselslider' ),
11
- 'view_item' => __( 'View Carousel', 'carouselslider' ),
12
- 'add_new_item' => __( 'Add New Carousel', 'carouselslider' ),
13
- 'add_new' => __( 'Add New', 'carouselslider' ),
14
- 'edit_item' => __( 'Edit Carousel', 'carouselslider' ),
15
- 'update_item' => __( 'Update Carousel', 'carouselslider' ),
16
- 'search_items' => __( 'Search Carousel', 'carouselslider' ),
17
- 'not_found' => __( 'Not found', 'carouselslider' ),
18
- 'not_found_in_trash' => __( 'Not found in Trash', 'carouselslider' ),
19
- );
20
- $rewrite = array(
21
- 'slug' => 'carousel',
22
- 'with_front' => true,
23
- 'pages' => true,
24
- 'feeds' => true,
25
- );
26
- $args = array(
27
- 'label' => __( 'Carousel', 'carouselslider' ),
28
- 'description' => __( 'Carousel', 'carouselslider' ),
29
- 'labels' => $labels,
30
- 'supports' => array( 'title', 'editor', 'thumbnail', ),
31
- 'hierarchical' => false,
32
- 'public' => true,
33
- 'show_ui' => true,
34
- 'show_in_menu' => true,
35
- 'show_in_nav_menus' => true,
36
- 'show_in_admin_bar' => true,
37
- 'menu_position' => 5,
38
- 'menu_icon' => 'dashicons-slides',
39
- 'can_export' => true,
40
- 'has_archive' => true,
41
- 'exclude_from_search' => false,
42
- 'publicly_queryable' => true,
43
- 'rewrite' => $rewrite,
44
- 'capability_type' => 'page',
45
- );
46
- register_post_type( 'carousel', $args );
47
-
48
- }
49
-
50
- // Hook into the 'init' action
51
- add_action( 'init', 'sis_carousel_custom_post_type', 0 );
52
-
53
- /* Move featured image box under title */
54
- function sis_carousel_img_box()
55
- {
56
- remove_meta_box( 'postimagediv', 'carousel', 'side' );
57
- add_meta_box('postimagediv', __('Upload Carousel Image', 'carouselslider'), 'post_thumbnail_meta_box', 'carousel', 'normal', 'high');
58
- }
59
- add_action('do_meta_boxes', 'sis_carousel_img_box');
60
-
61
- /*Shortcode for carousel by custom button*/
62
- function sis_get_carousel(){
63
- $siscarousel= '<div id="owl-carousel" class="owl-carousel">';
64
- $carousel_query= "post_type=carousel&posts_per_page=-1";
65
- query_posts($carousel_query);
66
- if (have_posts()) : while (have_posts()) : the_post();
67
- $img= get_the_post_thumbnail( $post->ID, 'large' );
68
- $siscarousel.='<div class="carousel_img">'.$img.'</div>';
69
- endwhile; endif; wp_reset_query();
70
- $siscarousel.= '</div>';
71
- return $siscarousel;
72
- }
73
-
74
- /**add the shortcode for the slider- for use in editor**/
75
- function sis_insert_carousel($atts, $content=null){
76
- $siscarousel= sis_get_carousel();
77
- return $siscarousel;
78
- }
79
- add_shortcode('all-carousels', 'sis_insert_carousel');
80
-
81
- /**add template tag- for use in themes**/
82
- function sis_carousel_for_theme(){
83
- print sis_get_carousel();
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
carousel-options.php DELETED
@@ -1,209 +0,0 @@
1
- <div id="wpbody">
2
- <div class="wrap">
3
- <h2><?php _e('Carousel Settings' ,'carouselslider'); ?></h2>
4
- <form action="options.php" method="post">
5
- <?php
6
- settings_fields( 'sis_carousel_settings' );
7
- $options = get_option( 'sis_carousel_settings' );
8
- ?>
9
- <table class="form-table">
10
- <tbody>
11
- <tr valign="top">
12
- <th scope="row">
13
- <label for="sis_carousel_settings[max_items]"><?php _e('Maximum Items' ,'carouselslider'); ?></label>
14
- </th>
15
- <td>
16
- <input type="number" min="1" max="10" name="sis_carousel_settings[max_items]" id="" value="<?php esc_attr_e($options['max_items']); ?>">
17
- <p class="description"><?php _e('This variable allows you to set the maximum amount of items displayed at a time with the widest browser width &#40;window &gt;= 1200&#41;' ,'carouselslider'); ?></p>
18
- </td>
19
- </tr>
20
- <tr valign="top">
21
- <th scope="row">
22
- <label for=""><?php _e('Items Desktop' ,'carouselslider'); ?></label>
23
- </th>
24
- <td>
25
- <input type="number" min="1" max="10" name="sis_carousel_settings[items_desktop]" id="" value="<?php esc_attr_e($options['items_desktop']); ?>">
26
- <p class="description"><?php _e('This allows you to preset the number of slides visible with &#40;window &lt;= 1199&#41; browser width' ,'carouselslider'); ?></p>
27
- </td>
28
- </tr>
29
- <tr valign="top">
30
- <th scope="row">
31
- <label for=""><?php _e('Items Desktop Small' ,'carouselslider'); ?></label>
32
- </th>
33
- <td>
34
- <input type="number" min="1" max="10" name="sis_carousel_settings[items_desktop_small]" id="" value="<?php esc_attr_e($options['items_desktop_small']); ?>">
35
- <p class="description"><?php _e('This allows you to preset the number of slides visible with &#40;window &lt;= 979&#41; browser width' ,'carouselslider'); ?></p>
36
- </td>
37
- </tr>
38
- <tr valign="top">
39
- <th scope="row">
40
- <label for=""><?php _e('Items Tablet' ,'carouselslider'); ?></label>
41
- </th>
42
- <td>
43
- <input type="number" min="1" max="10" name="sis_carousel_settings[items_tablet]" id="" value="<?php esc_attr_e($options['items_tablet']); ?>">
44
- <p class="description"><?php _e('This allows you to preset the number of slides visible with &#40;window &lt;= 768&#41; browser width' ,'carouselslider'); ?></p>
45
- </td>
46
- </tr>
47
- <tr valign="top">
48
- <th scope="row">
49
- <label for=""><?php _e('Items Mobile' ,'carouselslider'); ?></label>
50
- </th>
51
- <td>
52
- <input type="number" min="1" max="10" name="sis_carousel_settings[items_mobile]" id="" value="<?php esc_attr_e($options['items_mobile']); ?>">
53
- <p class="description"><?php _e('This allows you to preset the number of slides visible with &#40;window &lt;= 479&#41; browser width' ,'carouselslider'); ?></p>
54
- </td>
55
- </tr>
56
- <tr valign="top">
57
- <th scope="row">
58
- <label for="sis_carousel_settings[items_single]"><?php _e('Single Item' ,'carouselslider'); ?></label>
59
- </th>
60
- <td>
61
- <input type='radio' name='sis_carousel_settings[items_single]' value='false' <?php if ( 'false' == $options['items_single'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
62
- <input type='radio' name='sis_carousel_settings[items_single]' value='true' <?php if ( 'true' == $options['items_single'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
63
- <p class="description"><?php _e('If you select "Yes", it will display only one item and top five options will be automatically stopped.' ,'carouselslider'); ?></p>
64
- </td>
65
- </tr>
66
- <tr valign="top">
67
- <th scope="row">
68
- <label for="sis_carousel_settings[transitionstyle]"><?php _e('Transition Style' ,'carouselslider'); ?></label>
69
- </th>
70
- <td>
71
- <select name="sis_carousel_settings[transitionstyle]">
72
- <option value="fade" <?php selected( $options['transitionstyle'], 'fade' ); ?>><?php _e('fade' ,'carouselslider'); ?></option>
73
- <option value="backSlide" <?php selected( $options['transitionstyle'], 'backSlide' ); ?>><?php _e('backSlide' ,'carouselslider'); ?></option>
74
- <option value="goDown" <?php selected( $options['transitionstyle'], 'goDown' ); ?>><?php _e('goDown' ,'carouselslider'); ?></option>
75
- <option value="scaleUp" <?php selected( $options['transitionstyle'], 'scaleUp' ); ?>><?php _e('scaleUp' ,'carouselslider'); ?></option>
76
- </select>
77
- <p class="description"><?php _e('Transition style works only in modern browsers that support CSS3 translate3d methods and only with single item on screen.' ,'carouselslider'); ?></p>
78
- </td>
79
- </tr>
80
- <tr valign="top">
81
- <th scope="row">
82
- <label for=""><?php _e('Slide Speed' ,'carouselslider'); ?></label>
83
- </th>
84
- <td>
85
- <input type="number" name="sis_carousel_settings[slide_speed]" id="" value="<?php esc_attr_e($options['slide_speed']); ?>">
86
- <p class="description"><?php _e('Slide speed in milliseconds. Default speed is &lsquo;200&rsquo; milliseconds.' ,'carouselslider'); ?></p>
87
- </td>
88
- </tr>
89
- <tr valign="top">
90
- <th scope="row">
91
- <label for=""><?php _e('Pagination Speed' ,'carouselslider'); ?></label>
92
- </th>
93
- <td>
94
- <input type="number" name="sis_carousel_settings[pagination_speed]" id="" value="<?php esc_attr_e($options['pagination_speed']); ?>">
95
- <p class="description"><?php _e('Pagination speed in milliseconds. Default speed is &lsquo;800&rsquo; milliseconds.' ,'carouselslider'); ?></p>
96
- </td>
97
- </tr>
98
- <tr valign="top">
99
- <th scope="row">
100
- <label for=""><?php _e('Rewind Speed' ,'carouselslider'); ?></label>
101
- </th>
102
- <td>
103
- <input type="number" name="sis_carousel_settings[rewind_speed]" id="" value="<?php esc_attr_e($options['rewind_speed']); ?>">
104
- <p class="description"><?php _e('Rewind speed in milliseconds. Default speed is &lsquo;1000&rsquo; milliseconds.' ,'carouselslider'); ?></p>
105
- </td>
106
- </tr>
107
- <tr valign="top">
108
- <th scope="row">
109
- <label for="sis_carousel_autoplay"><?php _e('AutoPlay' ,'carouselslider'); ?></label>
110
- </th>
111
- <td>
112
- <input type="text" name="sis_carousel_settings[autoplay]" id="" value="<?php esc_attr_e($options['autoplay']); ?>">
113
- <p class="description"><?php _e('Change to any integrer for example &lsquo;autoPlay : 5000&rsquo; to play every 5 seconds. If you set &lsquo;autoPlay: true&rsquo; default speed will be 5 seconds.' ,'carouselslider'); ?></p>
114
- </td>
115
- </tr>
116
- <tr valign="top">
117
- <th scope="row">
118
- <label for=""><?php _e('Stop On Hover' ,'carouselslider'); ?></label>
119
- </th>
120
- <td>
121
- <input type='radio' name='sis_carousel_settings[stoponhover]' value='false' <?php if ( 'false' == $options['stoponhover'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
122
- <input type='radio' name='sis_carousel_settings[stoponhover]' value='true' <?php if ( 'true' == $options['stoponhover'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
123
- <p class="description"><?php _e('Stop autoplay on mouse hover.' ,'carouselslider'); ?></p>
124
- </td>
125
- </tr>
126
- <tr valign="top">
127
- <th scope="row">
128
- <label for=""><?php _e('Navigation' ,'carouselslider'); ?></label>
129
- </th>
130
- <td>
131
- <input type='radio' name='sis_carousel_settings[navigation]' value='false' <?php if ( 'false' == $options['navigation'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
132
- <input type='radio' name='sis_carousel_settings[navigation]' value='true' <?php if ( 'true' == $options['navigation'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
133
- <p class="description"><?php _e('Display &lsquo;next&rsquo; and &lsquo;prev&rsquo; buttons.' ,'carouselslider'); ?></p>
134
- </td>
135
- </tr>
136
- <tr valign="top">
137
- <th scope="row">
138
- <label for="sis_carousel_settings[navigation_bg_color]"><?php _e('Navigation Color' ,'carouselslider'); ?></label>
139
- </th>
140
- <td>
141
- <input type="text" name="sis_carousel_settings[navigation_bg_color]" id="navigation_bg_color" value="<?php esc_attr_e($options['navigation_bg_color']); ?>">
142
- <p class="description"><?php _e('Choose color for Navigation Background.' ,'carouselslider'); ?></p>
143
- </td>
144
- </tr>
145
- <tr valign="top">
146
- <th scope="row">
147
- <label for="sis_carousel_settings[navigation_arrow_color]"><?php _e('Navigation Arrow Color' ,'carouselslider'); ?></label>
148
- </th>
149
- <td>
150
- <input type="text" name="sis_carousel_settings[navigation_arrow_color]" id="navigation_arrow_color" value="<?php esc_attr_e($options['navigation_arrow_color']); ?>">
151
- <p class="description"><?php _e('Choose color for Navigation Arrow.' ,'carouselslider'); ?></p>
152
- </td>
153
- </tr>
154
- <tr valign="top">
155
- <th scope="row">
156
- <label for=""><?php _e('Scroll Per Page' ,'carouselslider'); ?></label>
157
- </th>
158
- <td>
159
- <input type='radio' name='sis_carousel_settings[scrollperpage]' value='false' <?php if ( 'false' == $options['scrollperpage'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
160
- <input type='radio' name='sis_carousel_settings[scrollperpage]' value='true' <?php if ( 'true' == $options['scrollperpage'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
161
- <p class="description"><?php _e('Scroll per page not per item. This affect next/prev buttons and mouse/touch dragging.' ,'carouselslider'); ?></p>
162
- </td>
163
- </tr>
164
- <tr valign="top">
165
- <th scope="row">
166
- <label for=""><?php _e('Pagination' ,'carouselslider'); ?></label>
167
- </th>
168
- <td>
169
- <input type='radio' name='sis_carousel_settings[pagination]' value='false' <?php if ( 'false' == $options['pagination'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
170
- <input type='radio' name='sis_carousel_settings[pagination]' value='true' <?php if ( 'true' == $options['pagination'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
171
- <p class="description"><?php _e('Show pagination.' ,'carouselslider'); ?></p>
172
- </td>
173
- </tr>
174
- <tr valign="top">
175
- <th scope="row">
176
- <label for=""><?php _e('Pagination Color' ,'carouselslider'); ?></label>
177
- </th>
178
- <td>
179
- <input type="text" name="sis_carousel_settings[pagination_bg_color]" id="pagination_bg_color" value="<?php esc_attr_e($options['pagination_bg_color']); ?>">
180
- <p class="description"><?php _e('Choose color for Pagination Background.' ,'carouselslider'); ?></p>
181
- </td>
182
- </tr>
183
- <tr valign="top">
184
- <th scope="row">
185
- <label for=""><?php _e('Pagination Numbers' ,'carouselslider'); ?></label>
186
- </th>
187
- <td>
188
- <input type='radio' name='sis_carousel_settings[paginationnumbers]' value='false' <?php if ( 'false' == $options['paginationnumbers'] ) echo 'checked="checked"'; ?> /> <?php _e('NO' ,'carouselslider'); ?>
189
- <input type='radio' name='sis_carousel_settings[paginationnumbers]' value='true' <?php if ( 'true' == $options['paginationnumbers'] ) echo 'checked="checked"'; ?> /> <?php _e('Yes' ,'carouselslider'); ?>
190
- <p class="description"><?php _e('Show numbers inside pagination buttons' ,'carouselslider'); ?></p>
191
- </td>
192
- </tr>
193
- <tr valign="top">
194
- <th scope="row">
195
- <label for=""><?php _e('Pagination Number Color' ,'carouselslider'); ?></label>
196
- </th>
197
- <td>
198
- <input type="text" name="sis_carousel_settings[pagination_num_color]" id="pagination_num_color" value="<?php esc_attr_e($options['pagination_num_color']); ?>">
199
- <p class="description"><?php _e('Choose color for Pagination Number.' ,'carouselslider'); ?></p>
200
- </td>
201
- </tr>
202
- </tbody>
203
- </table>
204
- <p class="submit"><input type="submit" value="<?php _e('Save Changes' ,'carouselslider') ?>" class="button button-primary" id="submit" name="submit"></p>
205
- </form>
206
- </div>
207
- <div class="clear"></div>
208
- </div>
209
- <div class="clear"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
carousel-slider.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Carousel Slider
4
+ Plugin URI: http://wordpress.org/plugins/carousel-slider
5
+ Description: Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
6
+ Version: 1.4.1
7
+ Author: Sayful Islam
8
+ Author URI: http://sayful.net
9
+ Text Domain: carouselslider
10
+ Domain Path: /languages/
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt
13
+ */
14
+
15
+ // If this file is called directly, abort.
16
+ if ( ! defined( 'WPINC' ) ) {
17
+ die;
18
+ }
19
+
20
+ /**
21
+ * The code that runs during plugin activation.
22
+ */
23
+ function activate_carousel_slider() {
24
+ require_once plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider_Activator.php';
25
+ Carousel_Slider_Activator::activate();
26
+ }
27
+
28
+ /**
29
+ * The code that runs during plugin deactivation.
30
+ */
31
+ function deactivate_carousel_slider() {
32
+ require_once plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider_Deactivator.php';
33
+ Carousel_Slider_Deactivator::deactivate();
34
+ }
35
+
36
+ register_activation_hook( __FILE__, 'activate_carousel_slider' );
37
+ register_deactivation_hook( __FILE__, 'deactivate_carousel_slider' );
38
+
39
+ /**
40
+ * The core plugin class that is used to define internationalization,
41
+ * dashboard-specific hooks, and public-facing site hooks.
42
+ */
43
+ require plugin_dir_path( __FILE__ ) . 'includes/Carousel_Slider.php';
44
+
45
+ /**
46
+ * Begins execution of the plugin.
47
+ */
48
+ function run_carousel_slider() {
49
+
50
+ $plugin = new Carousel_Slider();
51
+ $plugin->run();
52
+
53
+ }
54
+ run_carousel_slider();
carousel.php DELETED
@@ -1,235 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Carousel Slider
4
- Plugin URI: http://wordpress.org/plugins/carousel-slider
5
- Description: Touch enabled wordpress plugin that lets you create beautiful responsive carousel slider.
6
- Version: 1.3
7
- Author: Sayful Islam
8
- Author URI: http://sayful.net
9
- Text Domain: carouselslider
10
- Domain Path: /languages/
11
- License: GPLv2 or later
12
- */
13
-
14
- // Set up our WordPress Plugin
15
- function sis_carousel_check_WP_ver()
16
- {
17
- $options_array = array(
18
- // Most important owl features
19
- 'max_items' => '5',
20
- 'items_desktop' => '4',
21
- 'items_desktop_small' => '3',
22
- 'items_tablet' => '2',
23
- 'items_mobile' => '1',
24
- 'items_single' => 'false',
25
- //Basic Speeds
26
- 'slide_speed' => '200',
27
- 'pagination_speed' => '800',
28
- 'rewind_speed' => '1000',
29
- //Autoplay
30
- 'autoplay' => 'true',
31
- 'stoponhover' => 'true',
32
- //Navigation
33
- 'navigation' => 'false',
34
- 'navigation_bg_color' => '#869791',
35
- 'navigation_arrow_color' => '#ffffff',
36
- 'scrollperpage' => 'false',
37
- //Pagination
38
- 'pagination' => 'false',
39
- 'pagination_bg_color' => '#869791',
40
- 'paginationnumbers' => 'false',
41
- 'pagination_num_color' => '#ffffff',
42
- //Transitions
43
- 'transitionstyle' => 'fade',
44
- );
45
- if ( get_option( 'sis_carousel_settings' ) !== false ) {
46
- // The option already exists, so we just update it.
47
- update_option( 'sis_carousel_settings', $options_array );
48
- } else{
49
- // The option hasn't been added yet. We'll add it with $autoload set to 'no'.
50
- add_option( 'sis_carousel_settings', $options_array );
51
- }
52
- }
53
- register_activation_hook( __FILE__, 'sis_carousel_check_WP_ver' );
54
-
55
- /**
56
- * Load plugin textdomain.
57
- */
58
- function sis_carousel_load_textdomain() {
59
- load_plugin_textdomain( 'carouselslider', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
60
- }
61
- add_action( 'plugins_loaded', 'sis_carousel_load_textdomain' );
62
-
63
- //register settings
64
- function sis_carousel_settings_init(){
65
- register_setting( 'sis_carousel_settings', 'sis_carousel_settings' );
66
- }
67
- add_action( 'admin_init', 'sis_carousel_settings_init' );
68
-
69
- /* Adding coolor picker from Wordpress admin page */
70
- function sis_carousel_color_picker( $hook_suffix ) {
71
- // first check that $hook_suffix is appropriate for your admin page
72
- wp_enqueue_style( 'wp-color-picker' );
73
- wp_enqueue_script( 'sis-carousel-color-handle', plugins_url('/js/carousel-color-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
74
- }
75
- add_action( 'admin_enqueue_scripts', 'sis_carousel_color_picker' );
76
-
77
- /* Adding Latest jQuery from Wordpress */
78
- function sis_carousel_plugin_scripts() {
79
- wp_enqueue_script('jquery');
80
- wp_enqueue_script('sis_carousel_main_script',plugins_url( '/js/owl.carousel.js' , __FILE__ ),array( 'jquery' ));
81
-
82
- wp_enqueue_style('sis_carousel_main_style',plugins_url( '/css/owl.carousel.css' , __FILE__ ));
83
- wp_enqueue_style('sis_carousel_theme_style',plugins_url( '/css/owl.theme.css' , __FILE__ ));
84
- wp_enqueue_style('sis_carousel_transitions_style',plugins_url( '/css/owl.transitions.css' , __FILE__ ));
85
- }
86
- add_action('init', 'sis_carousel_plugin_scripts');
87
-
88
- /*Plugin options page */
89
-
90
- function sis_carousel_custom_menu_page(){
91
- add_options_page( __('Carousel Settings', 'carouselslider'), __('Carousels', 'carouselslider'), 'manage_options', 'carousel-slider/carousel-options.php');
92
- }
93
- add_action( 'admin_menu', 'sis_carousel_custom_menu_page' );
94
-
95
-
96
- /* Carousel activation hook*/
97
- function sis_carousel_activation_hook(){
98
- $options = get_option( 'sis_carousel_settings' );
99
- ?><script type="text/javascript">
100
- jQuery(document).ready(function() {
101
- jQuery("#owl-carousel").owlCarousel({
102
-
103
- // Most important owl features
104
- items : <?php echo $options['max_items']; ?>,
105
- itemsDesktop : [1199,<?php echo $options['items_desktop']; ?>],
106
- itemsDesktopSmall : [980,<?php echo $options['items_desktop_small']; ?>],
107
- itemsTablet: [768,<?php echo $options['items_tablet']; ?>],
108
- itemsMobile : [479,<?php echo $options['items_mobile']; ?>],
109
- singleItem : <?php echo $options['items_single']; ?>,
110
-
111
- //Basic Speeds
112
- slideSpeed : <?php echo $options['slide_speed']; ?>,
113
- paginationSpeed : <?php echo $options['pagination_speed']; ?>,
114
- rewindSpeed : <?php echo $options['rewind_speed']; ?>,
115
-
116
- //Autoplay
117
- autoPlay : <?php echo $options['autoplay']; ?>,
118
- stopOnHover : <?php echo $options['stoponhover']; ?>,
119
-
120
- // Navigation
121
- navigation : <?php echo $options['navigation']; ?>,
122
- navigationText : ["&lt;","&gt;"],
123
- rewindNav : true,
124
- scrollPerPage : <?php echo $options['scrollperpage']; ?>,
125
-
126
- //Pagination
127
- pagination : <?php echo $options['pagination']; ?>,
128
- paginationNumbers: <?php echo $options['paginationnumbers']; ?>,
129
-
130
- //Transitions
131
- transitionStyle : '<?php echo $options['transitionstyle']; ?>',
132
- });
133
- });
134
- </script>
135
- <?php }
136
- add_action('wp_footer','sis_carousel_activation_hook');
137
-
138
- function sis_carousel_custom_inline_style(){
139
- $options = get_option( 'sis_carousel_settings' );
140
- ?><style>
141
- /* Navigation */
142
- .owl-theme .owl-controls .owl-buttons div{
143
- color: <?php echo $options['navigation_arrow_color']; ?>;
144
- background: <?php echo $options['navigation_bg_color']; ?>;
145
- }
146
- /* Styling Pagination*/
147
- .owl-theme .owl-controls .owl-page span{
148
- background: <?php echo $options['pagination_bg_color']; ?>;
149
- }
150
- .owl-theme .owl-controls .owl-page span.owl-numbers{
151
- color: <?php echo $options['pagination_num_color']; ?>;
152
- }
153
- </style><?php
154
- }
155
- add_action('wp_head','sis_carousel_custom_inline_style');
156
-
157
- /*Shortcode for carousel by custom button*/
158
- function sis_carousel_wrapper_shortcode( $atts, $content = null ) {
159
- extract(shortcode_atts(array(
160
- 'id' =>'carouselsc',
161
- 'items' =>'4',
162
- 'itemsdesktop' =>'4',
163
- 'itemsdesktopsmall' =>'4',
164
- 'itemstablet' =>'3',
165
- 'itemsmobile' =>'2',
166
- 'singleitem' =>'false',
167
- 'slidespeed' =>'200',
168
- 'paginationspeed' =>'800',
169
- 'rewindspeed' =>'1000',
170
- 'autoplay' =>'true',
171
- 'stoponhover' =>'true',
172
- 'navigation' =>'false',
173
- 'scrollperpage' =>'false',
174
- 'pagination' =>'false',
175
- 'paginationnumbers' =>'false',
176
- 'transitionstyle' =>'fade',
177
- ), $atts));
178
- return '<div id="'.$id.'" class="owl-carousel">'.do_shortcode($content).'</div>
179
- <script type="text/javascript">
180
- jQuery(document).ready(function() {
181
- jQuery("#'.$id.'").owlCarousel({
182
- items : '.$items.',
183
- itemsDesktop : [1199,'.$itemsdesktop.'],
184
- itemsDesktopSmall : [980,'.$itemsdesktopsmall.'],
185
- itemsTablet: [768,'.$itemstablet.'],
186
- itemsMobile : [479,'.$itemsmobile.'],
187
- singleItem : '.$singleitem.',
188
- slideSpeed : '.$slidespeed.',
189
- paginationSpeed : '.$paginationspeed.',
190
- rewindSpeed : '.$rewindspeed.',
191
- autoPlay : '.$autoplay.',
192
- stopOnHover : '.$stoponhover.',
193
- navigation : '.$navigation.',
194
- navigationText : ["&lt;","&gt;"],
195
- rewindNav : true,
196
- scrollPerPage : '.$scrollperpage.',
197
- pagination : '.$pagination.',
198
- paginationNumbers: '.$paginationnumbers.',
199
- transitionStyle : "'.$transitionstyle.'",
200
- });
201
- });
202
- </script>';
203
- }
204
- add_shortcode( 'carousel', 'sis_carousel_wrapper_shortcode' );
205
-
206
- function sis_carousel_shortcode( $atts, $content = null ) {
207
- extract(shortcode_atts(array(
208
- 'img_link' =>'',
209
- 'href' =>'#',
210
- ), $atts));
211
- return '<div class=""><a href="'.$href.'"><img src="'.$img_link.'"></a></div>';
212
- }
213
- add_shortcode( 'item', 'sis_carousel_shortcode' );
214
-
215
- /* Add Accordion Shortcode Button on Post Visual Editor */
216
-
217
- function siscarousel_button() {
218
- add_filter ("mce_external_plugins", "siscarousel_button_js");
219
- add_filter ("mce_buttons", "siscarouselb");
220
- }
221
-
222
- function siscarousel_button_js($plugin_array) {
223
- $plugin_array['siscours'] = plugins_url('js/carousel-button.js', __FILE__);
224
- return $plugin_array;
225
- }
226
-
227
- function siscarouselb($buttons) {
228
- array_push ($buttons, 'siscarouseltriger');
229
- return $buttons;
230
- }
231
- add_action ('init', 'siscarousel_button');
232
-
233
-
234
- /*Files to Include */
235
- require_once('carousel-img-type.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Carousel_Slider.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Carousel_Slider {
4
+
5
+ protected $loader;
6
+
7
+ protected $plugin_name;
8
+
9
+ protected $version;
10
+
11
+ public function __construct() {
12
+
13
+ $this->plugin_name = 'carousel-slider';
14
+ $this->version = '1.4.1';
15
+
16
+ $this->load_dependencies();
17
+ $this->set_locale();
18
+ $this->define_admin_hooks();
19
+ $this->define_public_hooks();
20
+ $this->includes();
21
+
22
+ }
23
+
24
+ /**
25
+ * Load the required dependencies for this plugin.
26
+ * Create an instance of the loader which will be used to register the hooks
27
+ * with WordPress.
28
+ */
29
+ private function load_dependencies() {
30
+
31
+ /**
32
+ * The class responsible for orchestrating the actions and filters of the
33
+ * core plugin.
34
+ */
35
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/Carousel_Slider_Loader.php';
36
+
37
+ /**
38
+ * The class responsible for defining internationalization functionality
39
+ * of the plugin.
40
+ */
41
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/Carousel_Slider_i18n.php';
42
+
43
+ /**
44
+ * The class responsible for defining all actions that occur in the Dashboard.
45
+ */
46
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/Carousel_Slider_Admin.php';
47
+
48
+ /**
49
+ * The class responsible for defining all actions that occur in the Dashboard.
50
+ */
51
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/Carousel_Slider_Settings.php';
52
+
53
+ /**
54
+ * The class responsible for defining all actions that occur in the public-facing
55
+ * side of the site.
56
+ */
57
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/Carousel_Slider_Public.php';
58
+
59
+ $this->loader = new Carousel_Slider_Loader();
60
+
61
+ }
62
+
63
+ /**
64
+ * Define the locale for this plugin for internationalization.
65
+ *
66
+ * Uses the Carousel_Slider_i18n class in order to set the domain and to register the hook
67
+ * with WordPress.
68
+ */
69
+ private function set_locale() {
70
+
71
+ $plugin_i18n = new Carousel_Slider_i18n();
72
+ $plugin_i18n->set_domain( $this->get_plugin_name() );
73
+
74
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
75
+
76
+ }
77
+
78
+ /**
79
+ * Register all of the hooks related to the dashboard functionality of the plugin.
80
+ */
81
+ private function define_admin_hooks() {
82
+
83
+ $plugin_admin = new Carousel_Slider_Admin( $this->get_plugin_name(), $this->get_version() );
84
+
85
+ $this->loader->add_action( 'init', $plugin_admin, 'carousel_post_type' );
86
+ $this->loader->add_action( 'init', $plugin_admin, 'custom_taxonomy' );
87
+ $this->loader->add_action( 'init', $plugin_admin, 'custom_image_size' );
88
+ $this->loader->add_action( 'do_meta_boxes', $plugin_admin, 'carousel_image_box' );
89
+ $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_box' );
90
+ $this->loader->add_action( 'save_post', $plugin_admin, 'save_meta_box' );
91
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'carousel_admin_color' );
92
+ $this->loader->add_filter( 'mce_external_plugins', $plugin_admin, 'mce_plugin' );
93
+ $this->loader->add_filter( 'mce_buttons', $plugin_admin, 'mce_button' );
94
+
95
+ }
96
+
97
+ /**
98
+ * Register all of the hooks related to the public-facing functionality of the plugin.
99
+ */
100
+ private function define_public_hooks() {
101
+
102
+ $plugin_public = new Carousel_Slider_Public( $this->get_plugin_name(), $this->get_version() );
103
+
104
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
105
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
106
+ $this->loader->add_action( 'wp_head', $plugin_public, 'inline_styles' );
107
+
108
+ }
109
+
110
+ /**
111
+ * Include admin and frontend files.
112
+ */
113
+ public function includes() {
114
+
115
+ if( !is_admin() ){
116
+ $this->frontend_includes();
117
+ }
118
+
119
+ }
120
+
121
+ /**
122
+ * Include frontend files.
123
+ */
124
+ public function frontend_includes(){
125
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcodes.php';
126
+ }
127
+
128
+ public function run() {
129
+ $this->loader->run();
130
+ }
131
+
132
+ public function get_plugin_name() {
133
+ return $this->plugin_name;
134
+ }
135
+
136
+ public function get_loader() {
137
+ return $this->loader;
138
+ }
139
+
140
+ public function get_version() {
141
+ return $this->version;
142
+ }
143
+
144
+ }
includes/Carousel_Slider_Activator.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Carousel_Slider_Activator {
4
+
5
+ public static function activate() {
6
+
7
+ flush_rewrite_rules();
8
+
9
+ }
10
+
11
+ }
includes/Carousel_Slider_Deactivator.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Carousel_Slider_Deactivator {
4
+
5
+ public static function deactivate() {
6
+ flush_rewrite_rules();
7
+ }
8
+
9
+ }
includes/Carousel_Slider_Loader.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Register all actions and filters for the plugin
5
+ */
6
+ class Carousel_Slider_Loader {
7
+
8
+ protected $actions;
9
+
10
+ protected $filters;
11
+
12
+ public function __construct() {
13
+
14
+ $this->actions = array();
15
+ $this->filters = array();
16
+
17
+ }
18
+
19
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
20
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
21
+ }
22
+
23
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
24
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
25
+ }
26
+
27
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
28
+
29
+ $hooks[] = array(
30
+ 'hook' => $hook,
31
+ 'component' => $component,
32
+ 'callback' => $callback,
33
+ 'priority' => $priority,
34
+ 'accepted_args' => $accepted_args
35
+ );
36
+
37
+ return $hooks;
38
+
39
+ }
40
+
41
+ public function run() {
42
+
43
+ foreach ( $this->filters as $hook ) {
44
+ add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
45
+ }
46
+
47
+ foreach ( $this->actions as $hook ) {
48
+ add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
49
+ }
50
+
51
+ }
52
+
53
+ }
includes/Carousel_Slider_i18n.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Define the internationalization functionality
5
+ *
6
+ * Loads and defines the internationalization files for this plugin
7
+ * so that it is ready for translation.
8
+ */
9
+ class Carousel_Slider_i18n {
10
+
11
+ private $domain;
12
+
13
+ public function load_plugin_textdomain() {
14
+
15
+ load_plugin_textdomain(
16
+ $this->domain,
17
+ false,
18
+ dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
19
+ );
20
+
21
+ }
22
+
23
+ public function set_domain( $domain ) {
24
+ $this->domain = $domain;
25
+ }
26
+
27
+ }
includes/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
index.php CHANGED
@@ -1,2 +1,2 @@
1
  <?php
2
- //Silence is golden
1
  <?php
2
+ // Silence is golden
js/carousel-color-script.js DELETED
@@ -1,6 +0,0 @@
1
- jQuery(document).ready(function($){
2
- $('#navigation_bg_color').wpColorPicker();
3
- $('#navigation_arrow_color').wpColorPicker();
4
- $('#pagination_bg_color').wpColorPicker();
5
- $('#pagination_num_color').wpColorPicker();
6
- });
 
 
 
 
 
 
languages/carouselslider-bn_BD.mo CHANGED
File without changes
languages/carouselslider-bn_BD.po CHANGED
File without changes
languages/carouselslider.pot CHANGED
File without changes
public/Carousel_Slider_Public.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Carousel_Slider_Public {
4
+
5
+ private $plugin_name;
6
+
7
+ private $version;
8
+
9
+ public function __construct( $plugin_name, $version ) {
10
+
11
+ $this->plugin_name = $plugin_name;
12
+ $this->version = $version;
13
+
14
+ }
15
+
16
+ public function enqueue_styles() {
17
+
18
+ wp_register_style( 'owl-carousel', plugin_dir_url( __FILE__ ) . 'css/owl.carousel.css', array(), '1.3.2', 'all' );
19
+ wp_register_style( 'owl-theme', plugin_dir_url( __FILE__ ) . 'css/owl.theme.css', array(), '1.3.2', 'all' );
20
+ wp_register_style( 'owl-transitions', plugin_dir_url( __FILE__ ) . 'css/owl.transitions.css', array(), '1.3.2', 'all' );
21
+
22
+ wp_enqueue_style('owl-carousel');
23
+ wp_enqueue_style('owl-theme');
24
+ wp_enqueue_style('owl-transitions');
25
+
26
+ }
27
+
28
+ public function enqueue_scripts() {
29
+
30
+ wp_register_script( 'owl-carousel', plugin_dir_url( __FILE__ ) . 'js/owl.carousel.js', array( 'jquery' ), '1.3.2', true );
31
+
32
+ wp_enqueue_script('jquery');
33
+ wp_enqueue_script( 'owl-carousel' );
34
+
35
+ }
36
+
37
+ public function inline_styles(){
38
+ $this->options = get_option( 'sis_carousel_settings' );
39
+ ?><style>
40
+ .owl-buttons,
41
+ .owl-theme .owl-controls .owl-page span.owl-numbers {
42
+ color: <?php echo (isset($this->options['btn_color'])) ? $this->options['btn_color'] : '#dddddd'; ?>;
43
+ }
44
+ .owl-theme .owl-buttons .owl-prev,
45
+ .owl-theme .owl-buttons .owl-next,
46
+ .owl-theme .owl-controls .owl-page span{
47
+ background: <?php echo (isset($this->options['btn_bg_color'])) ? $this->options['btn_bg_color'] : '#666666'; ?>;
48
+ }
49
+ .owl-theme .owl-buttons .owl-prev,
50
+ .owl-theme .owl-buttons .owl-next,
51
+ .owl-theme .owl-controls .owl-page span{
52
+ opacity: <?php echo (isset($this->options['btn_opacity'])) ? $this->options['btn_opacity'] : '.4'; ?>;
53
+ }
54
+ </style><?php
55
+ }
56
+
57
+ }
{css → public/css}/owl.carousel.css RENAMED
File without changes
{css → public/css}/owl.theme.css RENAMED
@@ -1,28 +1,52 @@
1
- /*
2
- * Owl Carousel Owl Demo Theme
3
- * v1.3.2
4
- */
5
-
6
- .owl-theme .owl-controls{
7
- margin-top: 10px;
8
- text-align: center;
9
  }
10
-
11
- /* Styling Next and Prev buttons */
12
-
13
- .owl-theme .owl-controls .owl-buttons div{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  display: inline-block;
15
- zoom: 1;
16
- *display: inline;/*IE7 life-saver */
17
- margin: 5px;
18
- padding: 3px 10px;
19
- font-size: 12px;
20
- -webkit-border-radius: 30px;
21
- -moz-border-radius: 30px;
22
- border-radius: 30px;
23
- filter: Alpha(Opacity=50);/*IE7 fix*/
24
- opacity: 0.5;
 
 
 
 
 
25
  }
 
26
  /* Clickable class fix problem with hover on touch devices */
27
  /* Use it for non-touch hover action */
28
  .owl-theme .owl-controls.clickable .owl-buttons div:hover{
@@ -48,6 +72,7 @@
48
  -webkit-border-radius: 20px;
49
  -moz-border-radius: 20px;
50
  border-radius: 20px;
 
51
  }
52
 
53
  .owl-theme .owl-controls .owl-page.active span,
@@ -61,29 +86,10 @@
61
  .owl-theme .owl-controls .owl-page span.owl-numbers{
62
  height: auto;
63
  width: auto;
 
64
  padding: 2px 10px;
65
  font-size: 12px;
66
  -webkit-border-radius: 30px;
67
  -moz-border-radius: 30px;
68
  border-radius: 30px;
69
- }
70
-
71
- /* preloading images */
72
- .owl-controls{position: relative;}
73
- .owl-buttons {
74
- position: absolute;
75
- width: 100%;
76
- top: 0;
77
- }
78
- .owl-prev {
79
- left: 10px;
80
- position: absolute;
81
- }
82
- .owl-next {
83
- right: 10px;
84
- position: absolute;
85
- }
86
- .owl-item img {
87
- width: 100%;
88
- height: auto;
89
  }
1
+ .row:before,
2
+ .row:after {
3
+ display: table;
4
+ content: " ";
 
 
 
 
5
  }
6
+ .row:after {
7
+ clear: both;
8
+ }
9
+ .owl-controls .owl-buttons {
10
+ width: 100% !important;
11
+ position: absolute;
12
+ top: 50%;
13
+ -webkit-transform: translateY(-50%);
14
+ -ms-transform: translateY(-50%);
15
+ transform: translateY(-50%);
16
+ }
17
+ .owl-controls .owl-pagination {
18
+ position: absolute;
19
+ bottom: 0;
20
+ }
21
+ .owl-buttons {
22
+ color: #fff;
23
+ font-weight: 900;
24
+ width: 100%;
25
+ }
26
+ .owl-theme .owl-buttons .owl-prev,
27
+ .owl-theme .owl-buttons .owl-next{
28
+ font-size: 14px;
29
+ background: #666;
30
+ padding: 5px 10px;
31
+ border-radius: 20px;
32
  display: inline-block;
33
+ opacity: .2;
34
+ transition: all .5s;
35
+ }
36
+ .owl-theme:hover .owl-buttons .owl-prev,
37
+ .owl-theme:hover .owl-buttons .owl-next{
38
+ opacity: 1;
39
+ }
40
+ .owl-buttons .owl-prev{
41
+ left: 0;
42
+ margin-left: 5px;
43
+ }
44
+ .owl-buttons .owl-next{
45
+ right: 0;
46
+ margin-right: 5px;
47
+ position: absolute;
48
  }
49
+
50
  /* Clickable class fix problem with hover on touch devices */
51
  /* Use it for non-touch hover action */
52
  .owl-theme .owl-controls.clickable .owl-buttons div:hover{
72
  -webkit-border-radius: 20px;
73
  -moz-border-radius: 20px;
74
  border-radius: 20px;
75
+ background: #cad3d0;
76
  }
77
 
78
  .owl-theme .owl-controls .owl-page.active span,
86
  .owl-theme .owl-controls .owl-page span.owl-numbers{
87
  height: auto;
88
  width: auto;
89
+ color: #FFF;
90
  padding: 2px 10px;
91
  font-size: 12px;
92
  -webkit-border-radius: 30px;
93
  -moz-border-radius: 30px;
94
  border-radius: 30px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
{css → public/css}/owl.transitions.css RENAMED
File without changes
public/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden
{js → public/js}/carousel-button.js RENAMED
File without changes
public/js/carousel.png ADDED
Binary file
{js → public/js}/owl.carousel.js RENAMED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sayful
3
  Tags: carousel, carousel slider, image carousel, slider, responsive slider,
4
  Requires at least: 3.0
5
  Tested up to: 4.1
6
- Stable tag: 1.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -13,50 +13,92 @@ Touch enabled wordpress plugin that lets you create beautiful responsive carouse
13
 
14
  Fully written in jQuery, touch enabled wordpress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
15
 
16
- = Features =
17
 
18
- 1. Fully Responsive
19
- 2. Unlimited Carousel slider
20
- 3. Supported in all major browsers
21
- 4. Touch and Grab enabled
22
- 5. CSS3 3D Acceleration
23
- 6. Multiple carousel on single page
24
- 7. Light as a feather
25
 
 
26
 
27
- = Single Carousel Slider for a site =
28
 
29
- Just create your Carousel slider from the Carousels menu & paste the following shortcode where you want to display this carousel slider:
30
 
31
- `[all-carousels]`
32
 
33
- Or you can paste following to add carousel slider to your theme:
34
 
35
- `<?php echo do_shortcode('[all-carousels]'); ?>`
36
 
37
- = Multiple Carousel Slider for a site =
38
 
39
- If you want to use multiple carousel slider at diffrent page or post click on "Add Carousel Slider" button from WordPress visual editor [view screenshot](http://s.w.org/plugins/carousel-slider/screenshot-3.png?r=943201) and inside `img_link=''` put you image link and inside href="" put post, page or media link.
40
 
41
- or write the following code:
42
 
43
- `[carousel id="unique-id"][item href="" img_link=""][/carousel]`
44
 
45
- To change default options, you can add the following attributes:
46
 
47
- `[carousel id="" items="" itemsDesktop="" itemsDesktopSmall="" itemsTablet="" itemsMobile="" slideSpeed="" paginationSpeed="" rewindSpeed="" singleItem="false|true" autoPlay="false|true" stopOnHover="false|true" navigation="false|true" scrollPerPage="false|true" pagination="false|true" paginationNumbers="false|true" transitionStyle="fade|backSlide|goDown|scaleUp"][/carousel]`
48
 
49
- Repeat `[item href="" img_link=""]` as many image as you want. Inside `img_link=''` put you image link like
50
 
51
- `img_link='http://lorempixel.com/400/200/sports/1'` and inside `href=""` put post, page or media link
 
 
 
 
 
 
52
 
53
- To get image from your WordPress Media, go to Media >> Library and click on image which one you want to insert and copy URL and paste it into `img_link=''` like this:
54
 
55
- `img_link='http://localhost/wp/plugins/wp-content/uploads/2014/06/vlcsnap-2014-06-08-14h31m10s128.png'`
56
 
57
- = Here is a complete example of code of carousel slider with ten image: =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- `[carousel id="carousel-1"][item href="http://sayful.net" img_link="http://lorempixel.com/400/200/sports/1"][item img_link="http://lorempixel.com/400/200/sports/2"][item img_link="http://lorempixel.com/400/200/sports/3"][item img_link="http://lorempixel.com/400/200/sports/4"][item img_link="http://lorempixel.com/400/200/sports/5"][item img_link="http://lorempixel.com/400/200/sports/6"][item img_link="http://lorempixel.com/400/200/sports/7"][item img_link="http://lorempixel.com/400/200/sports/8"][item img_link="http://lorempixel.com/400/200/sports/9"][item img_link="http://lorempixel.com/400/200/sports/10"][/carousel]`
60
 
61
 
62
  == Installation ==
@@ -88,13 +130,23 @@ Do you have questions or issues with Carousel Slider? [Ask for support here](htt
88
 
89
  == Screenshots ==
90
 
91
- 1. Screenshot of Carousels custom post.
92
- 2. Screenshot of Options page.
93
- 3. Screenshot of Carousel shortcode button.
94
- 4. Screenshot of Carousel Front-end Example.
 
95
 
96
  == Changelog ==
97
 
 
 
 
 
 
 
 
 
 
98
  = version 1.3 =
99
 
100
  * Tested with WordPress version 4.1
@@ -123,4 +175,9 @@ Upgrade the plugin to get more features and better performance.
123
 
124
  == CONTACT ==
125
 
126
- [Sayful Islam](http://sayful1.wordpress.com/100-2/)
 
 
 
 
 
3
  Tags: carousel, carousel slider, image carousel, slider, responsive slider,
4
  Requires at least: 3.0
5
  Tested up to: 4.1
6
+ Stable tag: 1.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
13
 
14
  Fully written in jQuery, touch enabled wordpress plugin based on [OWL Carousel](http://www.owlgraphic.com/owlcarousel/) that lets you create beautiful responsive carousel slider.
15
 
16
+ = Usage - Settings, Carousels & Carousel Categories =
17
 
18
+ After installing or Upgrading go to `Settings >> Carousel Slider` and change the default settings as your need.
 
 
 
 
 
 
19
 
20
+ Then go to `Carousels >> Add New` and fill all fields as your need and don't forget to give Carousel Categories name if you want to add multiple carousel at your site.
21
 
22
+ Now go to page or post where you want to add Carousel slider and paste the following shortcode:
23
 
24
+ `[carousel_slider]`
25
 
26
+ You can add multiple slider at page or post by Carousel Categories slug from ( plugin version 1.4.0 ). To do this you must create Carousel Categories when you creating New Carousel. Now you can show your Carousel by categories slug. So add the following attribute to your shortcode:
27
 
28
+ `category_slug=''`
29
 
30
+ Set category to a comma separated list of Carousel Categories Slug to only show those. You also need to add a mandatory attribute `id=''` if you want to add multiple carousel slider at the same page or post and need to give a number manually that is unique with other carousel slider (It won't conflict with other WordPress IDs). Example:
31
 
32
+ `[carousel_slider id='1' category_slug='one']`
33
 
34
+ `[carousel_slider id='2' category_slug='one,two,three,four']`
35
 
 
36
 
 
37
 
38
+ = Usage - TinyMCE Button =
39
 
40
+ I am sorry that TinyMCE Button is not fully functional yet but it works well.
41
 
42
+ To add carousel slider at your page from TinyMCE visual editor and click on "Add Carousel Slider" button from WordPress visual editor [view screenshot](https://s.w.org/plugins/carousel-slider/screenshot-4.jpg?r=1098179) and it will output the following shortcode:
43
 
44
+ `[carousel id=""]
45
+ [item href="" img_link=""]
46
+ [item href="" img_link=""]
47
+ [item href="" img_link=""]
48
+ [item href="" img_link=""]
49
+ [item href="" img_link=""]
50
+ [/carousel]`
51
 
52
+ inside `img_link=''` put you image link and inside href="" put post, page, media or any link that you want to open on click. Repeat `[item href="" img_link=""]` as many image as you want.
53
 
54
+ = Change Default Functionality =
55
 
56
+ You can change default functionality by adding following optional attributes at `[carousel_slider]` and `[carousel][/carousel]` shortcode
57
+
58
+
59
+ `items = '4'` : to set the maximum amount of items displayed at a time with the widest browser width (window >= 1200)
60
+
61
+ `items_desktop = '4'` : This allows you to preset the number of slides visible with (window <= 1199) browser width
62
+
63
+ `items_desktop_small = '3'` : This allows you to preset the number of slides visible with (window <= 979) browser width
64
+
65
+ `items_tablet = '2'` : This allows you to preset the number of slides visible with (window <= 768) browser width
66
+
67
+ `items_mobile = '1'` : This allows you to preset the number of slides visible with (window <= 479) browser width
68
+
69
+ `single_item = 'false'` : If you set true, it will display only one item
70
+
71
+ `slide_speed = '200'` : Slide speed in milliseconds
72
+
73
+ `pagination_speed = '800'` : Pagination speed in milliseconds
74
+
75
+ `rewind_speed = '1000'` : Rewind speed in milliseconds
76
+
77
+ `auto_play = 'true'` : Change to any integrer for example auto_play : 5000 to play every 5 seconds. If you set auto_play: true default speed will be 5 seconds.
78
+
79
+ `stop_on_hover = 'true'` : Stop autoplay on mouse hover
80
+
81
+ `navigation = 'true'` : Display "next" and "prev" buttons.
82
+
83
+ `scroll_per_page = 'false'` : Scroll per page not per item. This affect next/prev buttons and mouse/touch dragging.
84
+
85
+ `pagination = 'false'` : Show or hide pagination.
86
+
87
+ `pagination_numbers = 'false'` : Show or hide numbers inside pagination buttons
88
+
89
+ `auto_height = 'false'` : Add height to owl-wrapper-outer so you can use diffrent heights on slides. Use it only for one item per page setting.
90
+
91
+ Example 1(Settings, Carousels & Carousel Categories):
92
+
93
+ `[carousel_slider id='1' category_slug='portfolio,two' items = '3' navigation = 'false']`
94
+
95
+ Example 2:
96
+
97
+ `[carousel id='' items = '3' navigation = 'false' slide_speed = '400']
98
+ [item href='' img_link='']
99
+ [item href='' img_link='']
100
+ [/carousel]`
101
 
 
102
 
103
 
104
  == Installation ==
130
 
131
  == Screenshots ==
132
 
133
+ 1. Screenshot of Carousel Slider Settings page
134
+ 2. Screenshot of Carousel Custom Post Type (Add New Carousel)
135
+ 3. Screenshot of Carousel Custom Post Type Categories
136
+ 4. Screenshot of Carousel shortcode button.
137
+ 5. Screenshot of Carousel Front-end Example.
138
 
139
  == Changelog ==
140
 
141
+ = version 1.4.0 =
142
+
143
+ * Added option to add custom image size
144
+ * Added option to link each slide to a URL
145
+ * Added option to open link in the same frame as it was clicked or in a new window or tab.
146
+ * Added feature to add multiple slider at page, post or theme by custom post category slug
147
+ * Re-write with Object-oriented programming (OOP)
148
+
149
+
150
  = version 1.3 =
151
 
152
  * Tested with WordPress version 4.1
175
 
176
  == CONTACT ==
177
 
178
+ [Sayful Islam](http://sayful1.wordpress.com/100-2/)
179
+
180
+
181
+ == Upgrade Notice ==
182
+
183
+ 1.4.0 is a major update. Some previous settings and shortcode will not work in this version. Check detail description befor upgrading to new version.
screenshot-1.jpg ADDED
Binary file
screenshot-1.png DELETED
Binary file
screenshot-2.jpg ADDED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.jpg ADDED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.jpg ADDED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.jpg ADDED
Binary file
shortcodes/shortcodes.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*Shortcode for carousel by custom button*/
4
+ function carousel_slider_shortcode($atts, $content=null){
5
+
6
+ extract(shortcode_atts(array(
7
+ 'id' =>'',
8
+ 'category_slug' =>'',
9
+ 'items' =>'4',
10
+ 'items_desktop' =>'4',
11
+ 'items_desktop_small' =>'3',
12
+ 'items_tablet' =>'2',
13
+ 'items_mobile' =>'1',
14
+ 'single_item' =>'false',
15
+ 'slide_speed' =>'200',
16
+ 'pagination_speed' =>'800',
17
+ 'rewind_speed' =>'1000',
18
+ 'auto_play' =>'true',
19
+ 'stop_on_hover' =>'true',
20
+ 'navigation' =>'true',
21
+ 'scroll_per_page' =>'false',
22
+ 'pagination' =>'false',
23
+ 'pagination_numbers' =>'false',
24
+ 'auto_height' =>'false',
25
+ ), $atts));
26
+
27
+ if (trim($category_slug) !='') {
28
+
29
+ $termname = $category_slug;
30
+
31
+ } else {
32
+ function all_terms(){
33
+ // It is blank
34
+ }
35
+ $termname = all_terms();
36
+ }
37
+
38
+ global $post;
39
+
40
+ $options = get_option('sis_carousel_settings');
41
+
42
+ ob_start();
43
+ ?>
44
+ <div id="" class="row">
45
+ <div id="carousel_slider<?php echo $id; ?>" class="owl-carousel">
46
+
47
+ <?php
48
+ query_posts("post_type=carousel&posts_per_page=-1&carousel_category=$termname");
49
+ if (have_posts()) : while (have_posts()) : the_post();
50
+
51
+ $image_size = (isset($options['image_size'])) ? $options['image_size'] : 'full';
52
+
53
+ $img= get_the_post_thumbnail( $post->ID, $image_size );
54
+
55
+
56
+ $carousel_link = get_post_meta( $post->ID, '_carousel_slider_slide_link_value', true );
57
+
58
+
59
+ if (trim($carousel_link) != '') {
60
+
61
+ $carousel_link = $carousel_link;
62
+
63
+ } else {
64
+
65
+ $carousel_link = '#';
66
+ }
67
+
68
+ $link_target = get_post_meta( $post->ID, '_carousel_slider_slide_link_target_value', true );
69
+ ?>
70
+
71
+ <div class="carousel_img">
72
+ <a target="<?php echo $link_target; ?>" href="<?php echo $carousel_link; ?>">
73
+ <?php echo $img; ?>
74
+ </a>
75
+ </div>
76
+
77
+ <?php endwhile; endif; wp_reset_query(); ?>
78
+
79
+ </div>
80
+ </div>
81
+ <script type="text/javascript">
82
+ jQuery(document).ready(function($) {
83
+ $("#carousel_slider<?php echo $id; ?>").owlCarousel({
84
+ // Most important owl features
85
+ items : <?php echo $items; ?>,
86
+ itemsDesktop : [1199,<?php echo $items_desktop; ?>],
87
+ itemsDesktopSmall : [980,<?php echo $items_desktop_small; ?>],
88
+ itemsTablet: [768,<?php echo $items_tablet; ?>],
89
+ itemsMobile : [479,<?php echo $items_mobile; ?>],
90
+ singleItem : <?php echo $single_item; ?>,
91
+
92
+ //Basic Speeds
93
+ slideSpeed : <?php echo $slide_speed; ?>,
94
+ paginationSpeed : <?php echo $pagination_speed; ?>,
95
+ rewindSpeed : <?php echo $rewind_speed; ?>,
96
+
97
+ //Autoplay
98
+ autoPlay : <?php echo $auto_play; ?>,
99
+ stopOnHover : <?php echo $stop_on_hover; ?>,
100
+
101
+ // Navigation
102
+ navigation : <?php echo $navigation; ?>,
103
+ navigationText : ["&lt;","&gt;"],
104
+ rewindNav : true,
105
+ scrollPerPage : <?php echo $scroll_per_page; ?>,
106
+
107
+ //Pagination
108
+ pagination : <?php echo $pagination; ?>,
109
+ paginationNumbers: <?php echo $pagination_numbers; ?>,
110
+
111
+ //Auto height
112
+ autoHeight : <?php echo $auto_height; ?>,
113
+
114
+ });
115
+ $(".owl-pagination").css("left", function(){
116
+ return ($(".owl-carousel.owl-theme").width() - $(this).width()) / 2;
117
+ });
118
+ })
119
+ </script>
120
+ <?php
121
+ ob_end_flush();
122
+ }
123
+
124
+ function carousel_slider_wrapper_shortcode($atts, $content=null){
125
+
126
+ extract(shortcode_atts(array(
127
+ 'id' =>'',
128
+ 'items' =>'4',
129
+ 'items_desktop' =>'4',
130
+ 'items_desktop_small' =>'3',
131
+ 'items_tablet' =>'2',
132
+ 'items_mobile' =>'1',
133
+ 'single_item' =>'false',
134
+ 'slide_speed' =>'200',
135
+ 'pagination_speed' =>'800',
136
+ 'rewind_speed' =>'1000',
137
+ 'auto_play' =>'true',
138
+ 'stop_on_hover' =>'true',
139
+ 'navigation' =>'true',
140
+ 'scroll_per_page' =>'false',
141
+ 'pagination' =>'false',
142
+ 'pagination_numbers' =>'false',
143
+ 'auto_height' =>'false',
144
+ ), $atts));
145
+
146
+ global $post;
147
+ ob_start();
148
+ ?>
149
+ <div id="" class="row">
150
+ <div id="carousel_slider<?php echo $id; ?>" class="owl-carousel">
151
+ <?php echo do_shortcode($content); ?>
152
+ </div>
153
+ </div>
154
+ <script type="text/javascript">
155
+ jQuery(document).ready(function($) {
156
+ $("#carousel_slider<?php echo $id; ?>").owlCarousel({
157
+ // Most important owl features
158
+ items : <?php echo $items; ?>,
159
+ itemsDesktop : [1199,<?php echo $items_desktop; ?>],
160
+ itemsDesktopSmall : [980,<?php echo $items_desktop_small; ?>],
161
+ itemsTablet: [768,<?php echo $items_tablet; ?>],
162
+ itemsMobile : [479,<?php echo $items_mobile; ?>],
163
+ singleItem : <?php echo $single_item; ?>,
164
+
165
+ //Basic Speeds
166
+ slideSpeed : <?php echo $slide_speed; ?>,
167
+ paginationSpeed : <?php echo $pagination_speed; ?>,
168
+ rewindSpeed : <?php echo $rewind_speed; ?>,
169
+
170
+ //Autoplay
171
+ autoPlay : <?php echo $auto_play; ?>,
172
+ stopOnHover : <?php echo $stop_on_hover; ?>,
173
+
174
+ // Navigation
175
+ navigation : <?php echo $navigation; ?>,
176
+ navigationText : ["&lt;","&gt;"],
177
+ rewindNav : true,
178
+ scrollPerPage : <?php echo $scroll_per_page; ?>,
179
+
180
+ //Pagination
181
+ pagination : <?php echo $pagination; ?>,
182
+ paginationNumbers: <?php echo $pagination_numbers; ?>,
183
+
184
+ //Auto height
185
+ autoHeight : <?php echo $auto_height; ?>,
186
+
187
+ });
188
+ $(".owl-pagination").css("left", function(){
189
+ return ($(".owl-carousel.owl-theme").width() - $(this).width()) / 2;
190
+ });
191
+ })
192
+ </script>
193
+ <?php
194
+ ob_end_flush();
195
+ }
196
+
197
+ function sis_carousel_shortcode( $atts, $content = null ) {
198
+ extract(shortcode_atts(array(
199
+ 'img_link' =>'',
200
+ 'href' =>'#',
201
+ 'target' =>'_self',
202
+ ), $atts));
203
+
204
+ return '<div class=""><a target="'.$target.'" href="'.$href.'"><img src="'.$img_link.'"></a></div>';
205
+ }
206
+
207
+ add_shortcode('carousel_slider', 'carousel_slider_shortcode');
208
+ add_shortcode('all-carousels', 'carousel_slider_shortcode');
209
+ add_shortcode( 'carousel', 'carousel_slider_wrapper_shortcode' );
210
+ add_shortcode( 'item', 'sis_carousel_shortcode' );
211
+ add_filter('widget_text', 'do_shortcode');
uninstall.php CHANGED
@@ -1,12 +1,9 @@
1
  <?php
2
-
3
- // If uninstall not called from WordPress, then exit
4
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ){
5
- exit;
6
  }
7
  // If uninstall called from WordPress, then delete option
8
  if ( get_option( 'sis_carousel_settings' ) != false ){
9
  delete_option( 'sis_carousel_settings' );
10
- }
11
-
12
- ?>
1
  <?php
2
+ // If uninstall not called from WordPress, then exit.
3
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+ exit;
 
5
  }
6
  // If uninstall called from WordPress, then delete option
7
  if ( get_option( 'sis_carousel_settings' ) != false ){
8
  delete_option( 'sis_carousel_settings' );
9
+ }