Changeset 2156268
- Timestamp:
- 09/13/2019 05:52:58 PM (6 years ago)
- Location:
- swiper-js-slider
- Files:
-
- 36 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
swiper-js-slider/trunk/README.txt
r2149746 r2156268 2 2 Contributors: midexigner, mfarazaly 3 3 Donate link: https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36 4 Tags: swiper, slider, js slider, image slider, wordpress slider 4 Tags: swiper, slider, js slider, image slider, wordpress slider, carousel, multirow 5 5 Requires at least: 5.1 6 6 Requires PHP: 5.2.4 7 7 Tested up to: 5.2.2 8 Stable tag: 5.08 Stable tag: 1.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Swiper Js Slider Simple to use and very effective. Most Modern Mobile Touch Slider12 Swiper Js Slider/Carousel with Multirow Simple to use and very effective. Most Modern Mobile Touch Slider 13 13 14 14 == Description == 15 15 16 Swiper Js Slider Simple to use and very effective. Most Modern Mobile Touch Slider16 Swiper Js Slider/Carousel with Multirow Simple to use and very effective. Most Modern Mobile Touch Slider 17 17 18 18 MOST POWERFUL FEATURES 19 19 20 Parameters 21 * slidesPerView | To Set Slider in to Carousel 22 * spaceBetween | In Carousel space between slides 23 * slidesPerColumn | Muti Row with Carousel 24 * initialSlide | Position of slider with index 25 * direction | Vertial or Horizontal 26 * speed | Sliders speed 27 * autoHeight | Auto Height adjust according to image height 28 * effect | Multiple Effects 29 20 30 Autoplay 21 31 * On/Off. 22 * Speed.32 * Delay 23 33 * Stop On Last Slide. 24 34 * Disable On Interection. … … 95 105 Of course! Smart Slider use protocol relative urls which works fine on http:// and on https:// too. 96 106 97 = Can I contribute to the develop pement? =107 = Can I contribute to the developement? = 98 108 99 109 Yes, you can make a <a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" rel="nofollow">donation</a> or suggest me code correction, see you in private message or via email : mfarazaly(at)gmail.com … … 108 118 6. screenshot-6 109 119 7. screenshot-7 120 8. screenshot-8 121 9. screenshot-9 122 10. screenshot-10 110 123 111 124 == Changelog == 125 126 = 1.0.1 = 127 * New Parameters of slides Added. 128 * Search bar added in slider settings. 129 * User Interface updated like, Delete all slides button added Display Total slides in slider. 130 * Code Clean. 131 * Shortcode Details added. 112 132 113 133 = 1.0.0 = -
swiper-js-slider/trunk/admin/css/admin.css
r2149740 r2156268 1 .swiperjsSection { 2 margin: 20px 0 0 0; 3 border: 1px solid #ddd; 1 .post-type-swiper_js_slides .swiperjsSection { 2 box-sizing: border-box; 3 position: relative; 4 margin: 0; 5 border: 0; 4 6 background: #fcfcfc; 5 box-sizing: border-box; 6 width: 99%; 7 position: relative; 8 } 9 10 .headSec { 11 display: block; 12 padding: 20px; 13 background: #ddd; 14 } 15 16 .headSec h1 span { 17 margin: 0; 18 font-size: 14px; 19 } 20 21 .swiperjsSection h1 { 7 width: 100%; 8 display: table; 9 } 10 11 .post-type-swiper_js_slides .swiperjsSection h1 { 22 12 font-size: 30px; 23 13 margin: 0; … … 25 15 } 26 16 27 .contentSection { 28 position: relative; 29 } 30 31 .nav-tab-side { 32 width: 250px; 33 margin: 0; 34 display: inline-block; 35 vertical-align: top; 17 .post-type-swiper_js_slides .swiperjsSection .tabSec { 18 display: none; 19 } 20 21 .post-type-swiper_js_slides .swiperjsSection .rightSide table { 22 width: 100%; 23 border: 0; 24 border-collapse: collapse; 25 } 26 27 .post-type-swiper_js_slides .swiperjsSection .rightSide table tr:nth-child(even) td { 36 28 background: #ffffff; 37 position: absolute; 38 left: 0; 39 top: 0; 40 bottom: 0; 41 border-right: 1px solid #ddd; 42 } 43 44 .nav-tab-side li { 45 margin: 0; 46 border-top: 1px solid #ddd; 47 outline: none; 48 } 49 50 .nav-tab-side li.active a, 51 .nav-tab-side li:hover a{ 52 background: #fcfcfc; 53 } 54 55 .nav-tab-side li.active a:after{ 56 display: block; 57 } 58 59 .nav-tab-side li:first-child { 60 border-top: 0px; 61 } 62 63 .nav-tab-side li a { 64 display: block; 29 } 30 31 .post-type-swiper_js_slides .swiperjsSection .rightSide table td { 32 width: 20%; 65 33 padding: 10px 15px; 66 background: #ffffff;67 position: relative;68 outline: none;69 text-decoration: none;70 font-size: 14px;71 text-transform: capitalize;72 letter-spacing: 0.5px;73 }74 75 .nav-tab-side li a:focus{76 box-shadow: none;77 }78 79 .nav-tab-side li a:after{80 content: '';81 position: absolute;82 right: -1px;83 top: 0;84 bottom: 0;85 background: #fcfcfc;86 width: 2px;87 display: none;88 }89 90 .swiperjsSection .rightSide {91 padding: 10px 10px 10px 275px;92 overflow: hidden;93 }94 95 .swiperjsSection.wrap div.updated,96 .swiperjsSection.wrap .notice {97 margin: 5px -20px -19px;98 }99 100 .gallery-form-table {101 width: 100%;102 margin-bottom: 5px;103 }104 105 .gallery-form-table ul {106 margin: 0;107 font-size: 0;108 }109 110 .gallery-form-table ul li {111 display: inline-block;112 vertical-align: top;113 border: 1px solid #eeeeee;114 padding: 5px;115 margin: 3px 4px;116 background: #ffffff;117 }118 119 .gallery-form-table ul li.ui-sortable-placeholder {120 min-height: 170px;121 border-style: dashed;122 visibility: visible !important;123 }124 125 .gallery-add span {126 margin: 4px 3px 0 -4px;127 }128 129 .actionButtons {130 text-align: center;131 margin-top: 5px;132 }133 134 .actionButtons .button {135 width: calc(50% - 4px);136 margin: 0 2px;137 }138 139 .actionButtons .remove-image {140 background: rgba(170, 0, 0, 0.65);141 border: 0;142 color: #ffffff;143 }144 145 .actionButtons .remove-image:hover {146 background: rgba(170, 0, 0, 0.75);147 color: #ffffff;148 }149 150 .actionButtons .button.change-image {151 border-color: #cdcdcd;152 }153 154 #swiper-js-slider-settings .inside {155 margin: 0;156 padding: 0;157 }158 159 .swiperjsSection.innerOptions {160 margin: 0;161 border: 0;162 background: #fcfcfc;163 width: 100%;164 display: table;165 }166 167 .swiperjsSection.innerOptions .tabSec{168 display: none;169 }170 171 .swiperjsSection.innerOptions .nav-tab-side {172 display: table-cell;173 vertical-align: top;174 position: relative;175 }176 177 .swiperjsSection.innerOptions .rightSide {178 display: table-cell;179 vertical-align: top;180 padding: 0;181 }182 183 .swiperjsSection.innerOptions .rightSide table {184 width: 100%;185 border: 0;186 border-collapse: collapse;187 }188 189 .swiperjsSection.innerOptions .rightSide table td {190 width: 20%;191 padding: 10px;192 34 border-bottom: 1px solid #eeeeee; 193 35 min-width: 130px; 194 36 } 195 37 196 . swiperjsSection.innerOptions .rightSide table td ul{38 .post-type-swiper_js_slides .swiperjsSection .rightSide table td ul { 197 39 margin-bottom: 0; 198 40 } 199 41 200 . swiperjsSection.innerOptions.rightSide table td+td {42 .post-type-swiper_js_slides .swiperjsSection .rightSide table td+td { 201 43 width: 80%; 202 44 border-left: 1px solid #eeeeee; 203 45 } 204 46 205 . swiperjsSection.innerOptions.rightSide input[type="text"] {206 width: 100%; 207 } 208 209 . swiperjsSection.innerOptions .rightSide td >label {47 .post-type-swiper_js_slides .swiperjsSection .rightSide input[type="text"] { 48 width: 100%; 49 } 50 51 .post-type-swiper_js_slides .swiperjsSection .rightSide td>label { 210 52 display: block; 211 53 font-weight: 500; 212 54 } 213 55 214 . swiperjsSection.innerOptions .rightSide span{56 .post-type-swiper_js_slides .swiperjsSection .rightSide span { 215 57 font-size: 12px; 216 58 display: block; … … 219 61 } 220 62 221 .swiperjsSection.innerOptions .rightSide td ul li{ 222 display: inline-block; 223 margin-right: 10px; 224 } 225 .swiperjsSection.innerOptions .rightSide td ul li input{ 226 margin-right: 5px; 227 } 228 .swiperjsSection.innerOptions .hiddenData{ 229 position: relative; 230 } 231 .swiperjsSection.innerOptions .hiddenData:after{ 63 .post-type-swiper_js_slides .swiperjsSection .rightSide td ul li { 64 display: inline-block; 65 margin-right: 10px; 66 } 67 68 .post-type-swiper_js_slides .swiperjsSection .rightSide td ul li input { 69 margin-right: 5px; 70 } 71 72 .post-type-swiper_js_slides .swiperjsSection .hiddenData { 73 position: relative; 74 } 75 76 .post-type-swiper_js_slides .swiperjsSection .hiddenData:after { 232 77 content: ''; 233 78 position: absolute; … … 240 85 } 241 86 242 . swiperjsSection.innerOptions .hiddenData ::selection{87 .post-type-swiper_js_slides .swiperjsSection .hiddenData ::selection { 243 88 background: transparent; 244 89 } 245 .addfooter{ 90 91 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side { 92 width: 250px; 93 margin: 0; 94 background: #ffffff; 95 border-right: 1px solid #eeeeee; 96 display: table-cell; 97 vertical-align: top; 98 position: relative; 99 } 100 101 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li { 102 margin: 0; 103 border-bottom: 1px solid #eeeeee; 104 outline: none; 105 } 106 107 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active a, 108 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:hover a { 109 background: #eeeeee; 110 } 111 112 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active, 113 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:hover { 114 border-color: #eeeeee; 115 } 116 117 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li.active a:after { 118 display: block; 119 } 120 121 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li:first-child { 122 border-top: 0px; 123 } 124 125 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li a { 126 display: block; 127 padding: 10px 15px; 128 background: #ffffff; 129 position: relative; 130 outline: none; 131 text-decoration: none; 132 font-size: 13px; 133 text-transform: capitalize; 134 letter-spacing: 0px; 135 font-weight: 500; 136 color: #1e70cd; 137 } 138 139 .post-type-swiper_js_slides .swiperjsSection .nav-tab-side li a:focus { 140 box-shadow: none; 141 } 142 143 .post-type-swiper_js_slides .swiperjsSection .rightSide { 144 display: table-cell; 145 vertical-align: top; 146 padding: 0; 147 } 148 149 .post-type-swiper_js_slides .swiperjsSection.wrap div.updated, 150 .post-type-swiper_js_slides .swiperjsSection.wrap .notice { 151 margin: 5px -20px -19px; 152 } 153 154 .post-type-swiper_js_slides .gallery-form-table { 155 width: 100%; 156 margin-bottom: 5px; 157 overflow: hidden; 158 } 159 160 .post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list { 161 margin: 0; 162 font-size: 0; 163 } 164 165 .post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list li { 166 display: inline-block; 167 vertical-align: top; 168 border: 1px solid #eeeeee; 169 padding: 5px; 170 margin: 3px 4px; 171 background: #ffffff; 172 cursor: move; 173 width: auto; 174 float: none; 175 text-align: center; 176 } 177 178 .post-type-swiper_js_slides .gallery-form-table ul#gallery-metabox-list li.ui-sortable-placeholder { 179 min-height: 170px; 180 border: 3px dashed #cccccc; 181 visibility: visible !important; 182 } 183 184 .post-type-swiper_js_slides .gallery-add span { 185 margin: 4px 3px 0 -4px; 186 } 187 188 .post-type-swiper_js_slides .actionButtons { 189 text-align: center; 190 margin-top: 5px; 191 } 192 193 .post-type-swiper_js_slides .actionButtons .button { 194 width: calc(50% - 4px); 195 margin: 0 2px; 196 } 197 198 .post-type-swiper_js_slides .actionButtons .remove-image { 199 background: rgba(170, 0, 0, 0.65); 200 border: 0; 201 color: #ffffff; 202 } 203 204 .post-type-swiper_js_slides .actionButtons .remove-image:hover { 205 background: rgba(170, 0, 0, 0.75); 206 color: #ffffff; 207 } 208 209 .post-type-swiper_js_slides .actionButtons .remove-image .dashicons { 210 vertical-align: middle; 211 } 212 213 .post-type-swiper_js_slides .actionButtons .button.change-image { 214 border-color: #cdcdcd; 215 } 216 217 .post-type-swiper_js_slides #swiper-js-slider-settings .inside { 218 margin: 0; 219 padding: 0; 220 } 221 222 .post-type-swiper_js_slides .addfooter { 246 223 position: relative; 247 224 padding: 10px 10px 0; … … 250 227 text-align: right; 251 228 } 252 .gallery-form-table .noDataFound{ 229 230 .post-type-swiper_js_slides .gallery-form-table .noDataFound { 253 231 text-align: center; 254 display: none; 255 } 232 display: none; 233 } 234 235 .post-type-swiper_js_slides .addfooter .removeAll { 236 float: left; 237 background-color: #c85959; 238 background: rgba(170, 0, 0, 0.65); 239 border: 0; 240 color: #ffffff; 241 line-height: 30px; 242 } 243 244 .post-type-swiper_js_slides .addfooter .removeAll:hover, 245 .post-type-swiper_js_slides .addfooter .removeAll:focus { 246 background: rgba(170, 0, 0, 0.75); 247 color: #ffffff; 248 } 249 250 .post-type-swiper_js_slides .addfooter .removeAll .dashicons { 251 vertical-align: middle; 252 font-size: 18px; 253 } 254 255 .post-type-swiper_js_slides .footerRight { 256 position: relative; 257 padding: 10px; 258 border-top: 1px solid #eeeeee; 259 margin: 0; 260 } 261 262 .post-type-swiper_js_slides .footerRight ul li { 263 vertical-align: middle; 264 } 265 266 .post-type-swiper_js_slides .shortcodeWrap { 267 padding: 10px; 268 border: 1px solid #ececec; 269 margin: 10px 0 0; 270 background: rgba(238, 238, 238, 0.42) 271 } 272 273 .post-type-swiper_js_slides .shortcodeWrap h4 { 274 margin: 0 0 6px 0; 275 font-size: 12px; 276 font-weight: 500; 277 } 278 279 .post-type-swiper_js_slides .shortcodeWrap input { 280 font-size: 12px; 281 font-weight: 500; 282 padding: 5px; 283 } 284 285 .post-type-swiper_js_slides .shortcodeWrap .copyData { 286 display: block; 287 text-align: right; 288 font-size: 11px; 289 margin: 5px 0 0 0; 290 } 291 292 .post-type-swiper_js_slides .saveAll .dashicons { 293 vertical-align: middle; 294 font-size: 16px; 295 margin: 2px 1px 0 0; 296 } 297 298 .post-type-swiper_js_slides #poststuff .stuffbox>h3, 299 .post-type-swiper_js_slides #poststuff h2, 300 .post-type-swiper_js_slides #poststuff h3.hndle { 301 background: #1e70cd; 302 color: #ffffff; 303 } 304 305 .post-type-swiper_js_slides .accordion-section-title:after, 306 .post-type-swiper_js_slides .handlediv, 307 .item-edit, 308 .post-type-swiper_js_slides .postbox .handlediv.button-link, 309 .post-type-swiper_js_slides .toggle-indicator { 310 color: #ffffff; 311 } 312 313 .post-type-swiper_js_slides.wp-core-ui .button-primary { 314 background: #1e70cd; 315 } 316 317 .post-type-swiper_js_slides .shortcode.column-shortcode .copyData { 318 display: block; 319 text-align: left; 320 font-size: 11px; 321 margin: 5px 0 0 0; 322 } 323 324 .post-type-swiper_js_slides .column-image { 325 width: 85px !important; 326 } 327 328 .post-type-swiper_js_slides .column-image .imgCount { 329 display: block; 330 text-align: center; 331 border: 0; 332 border-bottom: 0; 333 background: #1f73d2; 334 font-size: 11px; 335 font-weight: 600; 336 color: #ffffff; 337 padding: 2px 0; 338 } 339 340 .post-type-swiper_js_slides .column-image img { 341 width: 100%; 342 display: inherit; 343 } 344 345 .post-type-swiper_js_slides .widefat td, 346 .post-type-swiper_js_slides .widefat td ol, 347 .post-type-swiper_js_slides .widefat td p, 348 .post-type-swiper_js_slides .widefat td ul { 349 vertical-align: middle; 350 } 351 352 .post-type-swiper_js_slides .searchHead { 353 position: relative; 354 padding: 10px; 355 border-bottom: 1px solid #eeeeee; 356 margin: 0; 357 } 358 359 .post-type-swiper_js_slides .dtbl { 360 display: table; 361 width: 100%; 362 margin: 0; 363 } 364 365 .post-type-swiper_js_slides .dtbl li { 366 display: table-cell; 367 } 368 369 .post-type-swiper_js_slides .searchHead .searchFilter { 370 text-align: right; 371 } 372 373 .post-type-swiper_js_slides .searchHead .searchFilter input { 374 padding: 5px 10px; 375 min-width: 300px; 376 } 377 378 .post-type-swiper_js_slides .hidden { 379 display: none; 380 } 381 382 .post-type-swiper_js_slides .text-right { 383 text-align: right; 384 } 385 386 .post-type-swiper_js_slides.wp-core-ui .button.addShortCode { 387 background: #1e70cd; 388 color: #ffffff; 389 border: 0; 390 line-height: 27px; 391 } 392 393 .post-type-swiper_js_slides.wp-core-ui .button.addShortCode img { 394 margin: -2px 2px 0 0; 395 padding: 0; 396 } -
swiper-js-slider/trunk/admin/js/func-admin.js
r2149740 r2156268 1 1 2 jQuery(function($) { 3 4 var sjs_tabs_hash = window.location.hash, 5 sjs_current_tab = window.location.hash.replace('!', ''); 6 7 if (sjs_tabs_hash && sjs_tabs_hash.indexOf('sjs-tab') >= 0) { 8 var sjs_post_action = $('#post').attr('action'); 9 $('.nav-tab-side').find('.active').removeClass('active'); 10 $('.nav-tab-side li').find('a[href="' + sjs_current_tab + '"]').parent('li').addClass('active'); 11 $('.swiperjsSection .rightSide .tabSec').hide(); 12 $('.swiperjsSection .rightSide '+ sjs_current_tab).fadeIn(); 13 if (sjs_post_action) { 14 sjs_post_action = sjs_post_action.split('#')[0]; 15 $('#post').attr('action', sjs_post_action + window.location.hash); 16 } 17 }else{ 18 $('.swiperjsSection .rightSide .tabSec').first().fadeIn(); 19 } 20 2 21 3 22 var file_frame; … … 120 139 }); 121 140 } 122 }); 123 141 }).on('click', 'a.removeAll', function(e){ 142 e.preventDefault(); 143 if (confirm('Are you sure you want to remove all images?')) { 144 $('#gallery-metabox-list').html(''); 145 resetIndex(); 146 checkData(); 147 } 148 }).on('click', 'a.saveAll', function(e){ 149 e.preventDefault(); 150 $('#publish').trigger('click'); 151 }); 152 124 153 makeSortable(); 125 154 126 155 $('body').on('click', '.swiperjsSection .nav-tab-side li a', function(e){ 127 //e.preventDefault();156 e.preventDefault(); 128 157 var t = $(this), 129 v = t.attr('href'); 158 v = t.attr('href'), 159 d = t.attr('data-tab-id'), 160 s = $('.nav-tab-side').attr('data-update-hashbang'), 161 b = ((typeof t.attr('href') !== 'undefined') ? t.attr('href') : d); 130 162 $('.nav-tab-side li').removeClass('active'); 131 163 t.closest('li').addClass('active'); 132 164 $('.swiperjsSection .rightSide .tabSec').hide(); 133 165 $('.swiperjsSection .rightSide '+v).fadeIn(); 134 }); 135 136 var getUrl = window.location.href, 137 urlSplit = getUrl.split("#"); 138 console.log(urlSplit[1]); 139 if(urlSplit[1] != undefined){ 140 $('.nav-tab-side li').removeClass('active'); 141 $('.nav-tab-side li a[href="#'+ urlSplit[1] +'"]').closest('li').addClass('active'); 142 $('.swiperjsSection .rightSide .tabSec').hide(); 143 $('.swiperjsSection .rightSide #'+urlSplit[1]).fadeIn(); 144 }else{ 145 $('.swiperjsSection .rightSide .tabSec').first().fadeIn(); 146 } 166 167 if (s === '1') { 168 window.location.hash = b.split('#').join('#!'); 169 var sjs_post_action = $('#post').attr('action'); 170 if (sjs_post_action) { 171 sjs_post_action = sjs_post_action.split('#')[0]; 172 $('#post').attr('action', sjs_post_action + window.location.hash); 173 } 174 } 175 }); 176 177 $('.copyData').click(function(e) { 178 e.preventDefault(); 179 $(this).prev().focus(); 180 $(this).prev().select(); 181 document.execCommand('copy'); 182 }); 183 184 $('[data-search]').on('keyup', function() { 185 var searchVal = $(this).val(), 186 filterItems = $('[data-filter-item]'); 187 188 if ( searchVal != '' ) { 189 filterItems.addClass('hidden'); 190 $('.swiperjsSection .rightSide .tabSec').show(); 191 $('[data-filter-item][data-filter-name*="' + searchVal + '"]').removeClass('hidden'); 192 } else { 193 $('.swiperjsSection .rightSide .tabSec').hide(); 194 var getActive = $('.swiperjsSection .nav-tab-side li.active a').attr('href'); 195 $(getActive).fadeIn(); 196 filterItems.removeClass('hidden'); 197 } 198 }); 199 200 $(".addShortCode").on('click', function(e) { 201 //send_to_editor(jQuery("#sc_select :selected").val()); 202 e.preventDefault(); 203 }); 204 147 205 }); -
swiper-js-slider/trunk/inc/post-types.php
r2149740 r2156268 6 6 'name' => _x( 'Swiper Js Sliders', 'Post Type General Name', $prefix ), 7 7 'singular_name' => _x( 'Swiper Js Slide', 'Post Type Singular Name', $prefix ), 8 'menu_name' => __( 'Swiper Js Slide s', $prefix ),8 'menu_name' => __( 'Swiper Js Sliders', $prefix ), 9 9 'name_admin_bar' => __( 'Swiper Js Slides', $prefix ), 10 10 'archives' => __( 'Item Archives', $prefix ), … … 41 41 'show_in_menu' => true, 42 42 'menu_position' => 99, 43 'menu_icon' => 'dashicons-smiley',43 'menu_icon' => esc_url( plugins_url( 'admin/images/logo.png', dirname(__FILE__) ) ), 44 44 'show_in_admin_bar' => true, 45 45 'show_in_nav_menus' => true, -
swiper-js-slider/trunk/public/js/main.js
r2149740 r2156268 7 7 $('[data-slider]').each(function(){ 8 8 var t = $(this), 9 config = {}, 9 config = {}, 10 general = t.data('general'), 10 11 autoplay = t.data('autoplay'), 11 12 pagination = t.data('pagination'), 12 13 navigation = t.data('navigation'); 14 15 if(general){ 16 config = general; 17 } 13 18 14 19 if(autoplay){ … … 25 30 26 31 //console.log(config); 27 swiper_slider = new Swiper(t, config); 32 swiper_slider = new Swiper(t, config); 33 34 t.removeAttr('data-general'); 35 t.removeAttr('data-autoplay'); 36 t.removeAttr('data-pagination'); 37 t.removeAttr('data-navigation'); 28 38 }); 29 39 -
swiper-js-slider/trunk/shortcode/slide-js-shortcode.php
r2149740 r2156268 25 25 ); 26 26 27 $my_query = null; 28 $my_query = new WP_Query($args); 29 27 30 ob_start(); 28 $my_query = null;29 $my_query = new WP_Query($args);?>31 if ( $my_query->have_posts() ) { 32 ?> 30 33 31 34 32 35 <?php 36 $general = get_post_meta($atts['id'], $meta_prefix.'setting_general', true); 33 37 $autoplay = get_post_meta($atts['id'], $meta_prefix.'setting_autoplay', true); 34 38 $pagination = get_post_meta($atts['id'], $meta_prefix.'setting_pagination', true); 35 39 $navigation = get_post_meta($atts['id'], $meta_prefix.'setting_navigation', true); 36 37 40 38 41 $auto; … … 44 47 $navi; 45 48 $naviCheck = s_j_s_checkit('navigation', $navigation); 49 50 if($general){ 51 $gene = array( 52 "initialSlide" => s_j_s_checkit('initialSlide', $general), 53 "direction" => s_j_s_checkit('direction', $general), 54 "speed" => s_j_s_checkit('speed', $general), 55 "autoHeight" => filter_var(s_j_s_checkit('autoHeight', $general), FILTER_VALIDATE_BOOLEAN), 56 "effect" => s_j_s_checkit('effect', $general), 57 "slidesPerView" => s_j_s_checkit('slidesPerView', $general), 58 "slidesPerColumn" => s_j_s_checkit('slidesPerColumn', $general), 59 "spaceBetween" => s_j_s_checkit('spaceBetween', $general), 60 ); 61 } 46 62 47 63 if($autoCheck == 'false'){ … … 84 100 } 85 101 102 103 86 104 ?> 87 105 88 106 <div class="swiper-container" 89 107 data-slider='swiperSlider<?php echo $atts['id']; ?>' 108 data-general='<?php echo json_encode($gene, JSON_NUMERIC_CHECK); ?>' 90 109 data-autoplay='<?php echo json_encode($auto, JSON_NUMERIC_CHECK); ?>' 91 110 data-pagination='<?php echo json_encode($pagi, JSON_NUMERIC_CHECK); ?>' … … 93 112 <div class="swiper-wrapper"> 94 113 <?php 114 95 115 while ($my_query->have_posts()) : $my_query->the_post(); 96 116 $ids = get_post_meta(get_the_ID(), $meta_prefix.'gallery_id', true); … … 106 126 </div> 107 127 128 129 108 130 <?php if($pagiCheck != 'false'){ ?> 109 <div class="<?php echo $pagination['el']; ?>"></div>131 <div class="<?php echo s_j_s_checkit('el', $pagination); ?>"></div> 110 132 <?php } ?> 111 133 112 134 <?php if($naviCheck != 'false'){ ?> 113 <div class="<?php echo $navigation['prevEl']; ?>"></div>114 <div class="<?php echo $navigation['nextEl']; ?>"></div>135 <div class="<?php echo s_j_s_checkit('prevEl', $navigation); ?>"></div> 136 <div class="<?php echo s_j_s_checkit('nextEl', $navigation); ?>"></div> 115 137 <?php } ?> 116 138 </div> 139 140 <?php 141 }else{ 142 _e( 'Sorry, no slider were found.', 'textdomain' ); 143 //die; 144 } 145 ?> 117 146 118 147 119 148 <?php 149 150 120 151 $html = ob_get_clean(); 121 152 return $html; -
swiper-js-slider/trunk/swiper-js-slider.php
r2149740 r2156268 43 43 include_once( plugin_dir_path( __FILE__ ) . 'shortcode/slide-js-shortcode.php' ); 44 44 } 45 45 46 function register() { 46 47 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) ); … … 49 50 add_action( 'init', array( $this, 'custom_post_type' ) ); 50 51 } 52 51 53 public function settings_link( $links ) { 52 $settings_link = '<a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" target="_blank">Donate Now</a>'; 54 $settings_link = '<a href="https://www.getsafepay.com/io/quick-link?ql=link_02a7de15-7e02-4da3-a15f-b08bfc68ab36" target="_blank">Donate Now</a> | '; 55 $settings_link .= '<a href="edit.php?post_type=swiper_js_slides">Add Slider</a>'; 53 56 array_push( $links, $settings_link ); 54 57 return $links; … … 64 67 wp_enqueue_script( 'adminjs', plugins_url( '/admin/js/func-admin.js', __FILE__ ), array('jquery'), '1.0.0', true ); 65 68 } 69 66 70 function frontStyling() { 67 // enqueue all our scripts68 71 wp_enqueue_style( 'swiper-css-library', plugins_url( '/public/css/library.css', __FILE__ ) ); 69 72 wp_enqueue_style( 'swiper-css-main', plugins_url( '/public/css/main.css', __FILE__ ) ); … … 71 74 wp_enqueue_script( 'swiper-js-main', plugins_url( '/public/js/main.js', __FILE__ ), array('jquery'), '1.0.0', true ); 72 75 } 76 73 77 function activate() { 74 78 flush_rewrite_rules(); 75 79 } 80 76 81 function deactivate() { 77 82 flush_rewrite_rules(); -
swiper-js-slider/trunk/uninstall.php
r2149740 r2156268 18 18 } 19 19 20 // delette post meta21 #delete_post_meta_by_key( 'contest-video-points' );22 23 // delete option24 #delete_option( 'video-pcplugin-menu-style' );25 26 27 // Delete All Meta Option28 //ref: https://codex.wordpress.org/delete_post_meta29 30 20 foreach ( wp_load_alloptions() as $option => $value ) { 31 21 if ( strpos( $option, '_s_s_m_' ) === 0 ) { … … 33 23 } 34 24 } 35 36 /* global $wpdb;37 $plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_speedy_swiper_meta_%'" );38 foreach( $plugin_options as $option ) {39 delete_option( $option->option_name );40 } */ -
swiper-js-slider/trunk/views/front-columns.php
r2149740 r2156268 11 11 $addColumns = array(); 12 12 $addColumns['cb'] = '<input type="checkbox" />'; 13 $addColumns['image'] = 'Total Slides'; 13 14 $addColumns['title'] = 'Sliders'; 14 15 $addColumns['shortcode'] = 'Shortcode'; … … 20 21 // Create Custom Columns 21 22 function sjs_carousel_custom_column( $column, $post_id ){ 23 24 global $post; 25 $post_id = absint( $post_id ); 26 $meta_prefix = '_s_s_m_'; 27 22 28 switch( $column ){ 23 case 'shortcode' : 24 // shortcode column 25 GLOBAL $post; 26 echo '<input type="text" onfocus="this.select();" readonly="readonly" value="[swiper-js-slider id='. $post->ID .']" class="large-text code">'; 27 break; 29 case 'shortcode': ?> 30 <input type="text" readonly="readonly" value='[swiper-js-slider id="<?php echo $post->ID ?>"]' class="large-text code"> 31 <a href="#" class="copyData">Copy to clipboard</a> 32 <?php 33 break; 34 35 case 'image': 36 $ids = get_post_meta( $post_id, $meta_prefix.'gallery_id', true ); 37 38 if ( ! empty( $ids ) && is_array( $ids ) ) { 39 $image = wp_get_attachment_image_src($ids[0]); 40 $total = count($ids); 41 echo '<img src="' . esc_url($image[0]) . '" width="75" height="50">'; 42 echo '<span class="imgCount">'; 43 echo ($total == 1) ? $total . " Slide" : $total . " Slides"; 44 echo '</span>'; 45 } 46 break; 28 47 } 29 48 } -
swiper-js-slider/trunk/views/meta-box-options.php
r2149740 r2156268 59 59 $ids = get_post_meta($post->ID, $this->meta_prefix.'gallery_id', true); 60 60 61 62 63 61 // Display the form, using the current value. 64 62 ?> … … 75 73 </a> 76 74 <a class="remove-image button button-small" href="#"> 77 <span class="dashicons dashicons- trash"></span>75 <span class="dashicons dashicons-no-alt"></span> 78 76 </a> 79 77 </div> … … 86 84 87 85 <div class="addfooter"> 86 <a href="#" class="removeAll button button-secondary button-large"> 87 <span class="dashicons dashicons-trash"></span> 88 Empty Slider 89 </a> 90 <a href="#" class="saveAll button button-primary button-large"> 91 <span class="dashicons dashicons-admin-tools"></span> 92 Save 93 </a> 88 94 <a class="gallery-add button button-primary button-large" 89 95 href="#" … … 109 115 global $post; 110 116 111 wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' ); 112 113 $autoplay = get_post_meta($post->ID, $this->meta_prefix.'setting_autoplay', true); 114 $pagination = get_post_meta($post->ID, $this->meta_prefix.'setting_pagination', true); 115 $navigation = get_post_meta($post->ID, $this->meta_prefix.'setting_navigation', true); 116 117 $autoplay = array( 118 "autoplay" => $this->s_j_s_checkit('autoplay', $autoplay, 'true'), 119 "delay" => $this->s_j_s_checkit('delay', $autoplay, '3000'), 120 "stopOnLastSlide" => $this->s_j_s_checkit('stopOnLastSlide', $autoplay, 'false'), 121 "disableOnInteraction" => $this->s_j_s_checkit('disableOnInteraction', $autoplay, 'true'), 122 "reverseDirection" => $this->s_j_s_checkit('reverseDirection', $autoplay, 'false'), 123 "waitForTransition" => $this->s_j_s_checkit('waitForTransition', $autoplay, 'true') 124 ); 125 126 $pagination = array( 127 "pagination" => $this->s_j_s_checkit('pagination', $pagination, 'true'), 128 "el" => $this->s_j_s_checkit('el', $pagination, 'swiper-pagination'), 129 "type" => $this->s_j_s_checkit('type', $pagination, 'bullets'), 130 "bulletElement" => $this->s_j_s_checkit('bulletElement', $pagination, 'span'), 131 "clickable" => $this->s_j_s_checkit('clickable', $pagination, 'false'), 132 "bulletClass" => $this->s_j_s_checkit('bulletClass', $pagination, 'swiper-pagination-bullet'), 133 "currentClass" => $this->s_j_s_checkit('currentClass', $pagination, 'swiper-pagination-current'), 134 "bulletActiveClass" => $this->s_j_s_checkit('bulletActiveClass', $pagination, 'swiper-pagination-bullet-active'), 135 "clickableClass" => $this->s_j_s_checkit('clickableClass', $pagination, 'swiper-pagination-clickable'), 136 "lockClass" => $this->s_j_s_checkit('lockClass', $pagination, 'swiper-pagination-lock'), 137 ); 138 139 $navigation = array( 140 "navigation" => $this->s_j_s_checkit('navigation', $navigation, 'true'), 141 "nextEl" => $this->s_j_s_checkit('nextEl', $navigation, 'swiper-button-next'), 142 "prevEl" => $this->s_j_s_checkit('prevEl', $navigation, 'swiper-button-prev'), 143 "disabledClass" => $this->s_j_s_checkit('disabledClass', $navigation, 'swiper-button-disabled'), 144 "hiddenClass" => $this->s_j_s_checkit('hiddenClass', $navigation, 'swiper-button-hidden'), 145 ); 146 147 ?> 117 wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' ); ?> 118 119 <div class="searchHead"> 120 <ul class="dtbl"> 121 <li class="searchFilter"><input type="text" placeholder="Search in setting..." data-search></li> 122 </ul> 123 </div> 148 124 149 125 <div class="swiperjsSection innerOptions"> 150 151 <ul class="nav-tab-side"> 152 <li class="active"><a href="#autoplay">Autoplay</a></li> 153 <li><a href="#pagination">Pagination</a></li> 154 <li><a href="#navigation">Navigation</a></li> 126 127 <ul class="nav-tab-side" data-update-hashbang="1"> 128 <li class="active"><a href="#sjs-tab-parameters">Parameters</a></li> 129 <li><a href="#sjs-tab-autoplay">Autoplay</a></li> 130 <li><a href="#sjs-tab-pagination">Pagination</a></li> 131 <li><a href="#sjs-tab-navigation">Navigation</a></li> 132 <li><a href="#sjs-tab-carousel">Carousel</a></li> 155 133 </ul> 156 134 157 135 <div class="rightSide"> 158 <div id="autoplay" class="tabSec autoPlay"> 159 <table> 160 <tbody> 161 <tr> 162 <td> 163 <label>Autoplay</label> 164 </td> 165 <td> 166 <ul> 167 <li> 168 <label> 169 <input 170 type="radio" 171 name="<?php echo $this->meta_prefix.'setting_autoplay[autoplay]'; ?>" 172 value="true" 173 <?php checked( $autoplay['autoplay'], 'true' ); ?>> True 174 </label> 175 </li> 176 <li> 177 <label> 178 <input 179 type="radio" 180 name="<?php echo $this->meta_prefix.'setting_autoplay[autoplay]'; ?>" 181 value="false" 182 <?php checked( $autoplay['autoplay'], 'false' ); ?>> False 183 </label> 184 </li> 185 </ul> 186 </td> 187 </tr> 188 </tbody> 189 </table> 190 191 <div class="<?php echo ($autoplay['autoplay'] == 'false' ? 'hiddenData' : '' ) ?>"> 192 <table class="autoPlaySettings"> 193 <tbody> 194 <tr> 195 <td> 196 <label for="apDelay">Delay</label> 197 </td> 198 <td> 199 <span>Delay between transitions (in ms).</span> 200 <input 201 id="apDelay" 202 name="<?php echo $this->meta_prefix.'setting_autoplay[delay]'; ?>" 203 type="text" 204 value="<?php echo $autoplay['delay']; ?>"> 205 </td> 206 </tr> 207 <tr> 208 <td> 209 <label>stopOnLastSlide</label> 210 </td> 211 <td> 212 <span>Enable this parameter and autoplay will be stopped when it reaches last slide (has no effect in loop mode)</span> 213 <ul> 214 <li> 215 <label> 216 <input 217 name="<?php echo $this->meta_prefix.'setting_autoplay[stopOnLastSlide]'; ?>" 218 type="radio" 219 <?php checked( $autoplay['stopOnLastSlide'], 'true' ); ?> 220 value="true">True 221 </label> 222 </li> 223 <li> 224 <label> 225 <input 226 name="<?php echo $this->meta_prefix.'setting_autoplay[stopOnLastSlide]'; ?>" 227 type="radio" 228 <?php checked( $autoplay['stopOnLastSlide'], 'false' ); ?> 229 value="false">False 230 </label> 231 </li> 232 </ul> 233 </td> 234 </tr> 235 <tr> 236 <td> 237 <label>disableOnInteraction</label> 238 </td> 239 <td> 240 <span>Set to false and autoplay will not be disabled after user interactions (swipes), it will be restarted every time after interaction</span> 241 <ul> 242 <li> 243 <label> 244 <input 245 name="<?php echo $this->meta_prefix.'setting_autoplay[disableOnInteraction]'; ?>" 246 type="radio" 247 <?php checked( $autoplay['disableOnInteraction'], 'true' ); ?> 248 value="true">True 249 </label> 250 </li> 251 <li> 252 <label> 253 <input 254 name="<?php echo $this->meta_prefix.'setting_autoplay[disableOnInteraction]'; ?>" 255 type="radio" 256 <?php checked( $autoplay['disableOnInteraction'], 'false' ); ?> 257 value="false">False 258 </label> 259 </li> 260 </ul> 261 </td> 262 </tr> 263 <tr> 264 <td> 265 <label>reverseDirection</label> 266 </td> 267 <td> 268 <span>Enables autoplay in reverse direction</span> 269 <ul> 270 <li> 271 <label> 272 <input 273 name="<?php echo $this->meta_prefix.'setting_autoplay[reverseDirection]'; ?>" 274 type="radio" 275 <?php checked( $autoplay['reverseDirection'], 'true' ); ?> 276 value="true">True 277 </label> 278 </li> 279 <li> 280 <label> 281 <input 282 name="<?php echo $this->meta_prefix.'setting_autoplay[reverseDirection]'; ?>" 283 type="radio" 284 <?php checked( $autoplay['reverseDirection'], 'false' ); ?> 285 value="false">False 286 </label> 287 </li> 288 </ul> 289 </td> 290 </tr> 291 <tr> 292 <td> 293 <label>waitForTransition</label> 294 </td> 295 <td> 296 <span>When enabled autoplay will wait for wrapper transition to continue. Can be disabled in case of using Virtual Translate when your slider may not have transition</span> 297 <ul> 298 <li> 299 <label> 300 <input 301 name="<?php echo $this->meta_prefix.'setting_autoplay[waitForTransition]'; ?>" 302 type="radio" 303 <?php checked( $autoplay['waitForTransition'], 'true' ); ?> 304 value="true">True 305 </label> 306 </li> 307 <li> 308 <label> 309 <input 310 name="<?php echo $this->meta_prefix.'setting_autoplay[waitForTransition]'; ?>" 311 type="radio" 312 <?php checked( $autoplay['waitForTransition'], 'false' ); ?> 313 value="false">False 314 </label> 315 </li> 316 </ul> 317 </td> 318 </tr> 319 </tbody> 320 </table> 321 </div> 322 </div> 323 324 <div id="pagination" class="tabSec pagiNation"> 325 <table> 326 <tbody> 327 <tr> 328 <td> 329 <label>Pagination</label> 330 </td> 331 <td> 332 <ul> 333 <li> 334 <label> 335 <input 336 type="radio" 337 name="<?php echo $this->meta_prefix.'setting_pagination[pagination]'; ?>" 338 value="true" 339 <?php checked( $pagination['pagination'], 'true' ); ?>> True 340 </label> 341 </li> 342 <li> 343 <label> 344 <input 345 type="radio" 346 name="<?php echo $this->meta_prefix.'setting_pagination[pagination]'; ?>" 347 value="false" 348 <?php checked( $pagination['pagination'], 'false' ); ?>> False 349 </label> 350 </li> 351 </ul> 352 </td> 353 </tr> 354 </tbody> 355 </table> 356 357 <div class="<?php echo ($pagination['pagination'] == 'false' ? 'hiddenData' : '' ) ?>"> 358 <table class="autoPlaySettings"> 359 <tr> 360 <td> 361 <label for="el">Element Class</label> 362 </td> 363 <td> 364 <span>Class Name for Pagination.</span> 365 <input 366 id="el" 367 name="<?php echo $this->meta_prefix.'setting_pagination[el]'; ?>" 368 type="text" 369 value="<?php echo $pagination['el']; ?>"> 370 </td> 371 </tr> 372 <tr> 373 <td> 374 <label for="">type</label> 375 </td> 376 <td> 377 <span>String with type of pagination.</span> 378 <select name="<?php echo $this->meta_prefix.'setting_pagination[type]'; ?>"> 379 <option value="bullets" <?php selected($pagination['type'], 'bullets') ?>>bullets</option> 380 <option value="fraction" <?php selected($pagination['type'], 'fraction') ?>>fraction</option> 381 <option value="progressbar" <?php selected($pagination['type'], 'progressbar') ?>>progressbar</option> 382 <option value="custom" <?php selected($pagination['type'], 'custom') ?>>custom</option> 383 </select> 384 </td> 385 </tr> 386 <tr> 387 <td> 388 <label for="bulletEle">bulletElement</label> 389 </td> 390 <td> 391 <span>Defines which HTML tag will be use to represent single pagination bullet. Only for bullets pagination type.</span> 392 <input 393 id="bulletEle" 394 name="<?php echo $this->meta_prefix.'setting_pagination[bulletElement]'; ?>" 395 type="text" 396 value="<?php echo $pagination['bulletElement']; ?>"> 397 </td> 398 </tr> 399 <tr> 400 <td> 401 <label>clickable</label> 402 </td> 403 <td> 404 <span>If true then clicking on pagination button will cause transition to appropriate slide. Only for bullets pagination type</span> 405 <ul> 406 <li> 407 <label> 408 <input 409 name="<?php echo $this->meta_prefix.'setting_pagination[clickable]'; ?>" 410 type="radio" 411 <?php checked( $pagination['clickable'], 'true' ); ?> 412 value="true">True 413 </label> 414 </li> 415 <li> 416 <label> 417 <input 418 name="<?php echo $this->meta_prefix.'setting_pagination[clickable]'; ?>" 419 type="radio" 420 <?php checked( $pagination['clickable'], 'false' ); ?> 421 value="false">False 422 </label> 423 </li> 424 </ul> 425 </td> 426 </tr> 427 <tr> 428 <td> 429 <label for="bulletClass">bulletClass</label> 430 </td> 431 <td> 432 <span>CSS class name of single pagination bullet</span> 433 <input 434 id="bulletClass" 435 name="<?php echo $this->meta_prefix.'setting_pagination[bulletClass]'; ?>" 436 type="text" 437 value="<?php echo $pagination['bulletClass']; ?>"> 438 </td> 439 </tr> 440 <tr> 441 <td> 442 <label for="currentClass">currentClass</label> 443 </td> 444 <td> 445 <span>CSS class name of the element with currently active index in "fraction" pagination</span> 446 <input 447 id="currentClass" 448 name="<?php echo $this->meta_prefix.'setting_pagination[currentClass]'; ?>" 449 type="text" 450 value="<?php echo $pagination['currentClass']; ?>"> 451 </td> 452 </tr> 453 <tr> 454 <td> 455 <label for="bulletActiveClass">bulletActiveClass</label> 456 </td> 457 <td> 458 <span>CSS class name of currently active pagination bullet</span> 459 <input 460 id="bulletActiveClass" 461 name="<?php echo $this->meta_prefix.'setting_pagination[bulletActiveClass]'; ?>" 462 type="text" 463 value="<?php echo $pagination['bulletActiveClass']; ?>"> 464 </td> 465 </tr> 466 <tr> 467 <td> 468 <label for="clickableClass">clickableClass</label> 469 </td> 470 <td> 471 <span>CSS class name set to pagination when it is clickable</span> 472 <input 473 id="clickableClass" 474 name="<?php echo $this->meta_prefix.'setting_pagination[clickableClass]'; ?>" 475 type="text" 476 value="<?php echo $pagination['clickableClass']; ?>"> 477 </td> 478 </tr> 479 <tr> 480 <td> 481 <label for="lockClass">lockClass</label> 482 </td> 483 <td> 484 <span>CSS class name set to pagination when it is disabled</span> 485 <input 486 id="lockClass" 487 name="<?php echo $this->meta_prefix.'setting_pagination[lockClass]'; ?>" 488 type="text" 489 value="<?php echo $pagination['lockClass']; ?>"> 490 </td> 491 </tr> 492 </table> 493 </div> 494 </div> 495 496 <div id="navigation" class="tabSec navigation"> 497 <table> 498 <tbody> 499 <tr> 500 <td> 501 <label>Navigation</label> 502 </td> 503 <td> 504 <ul> 505 <li> 506 <label> 507 <input 508 type="radio" 509 name="<?php echo $this->meta_prefix.'setting_navigation[navigation]'; ?>" 510 value="true" 511 <?php checked( $navigation['navigation'], 'true' ); ?>> True 512 </label> 513 </li> 514 <li> 515 <label> 516 <input 517 type="radio" 518 name="<?php echo $this->meta_prefix.'setting_navigation[navigation]'; ?>" 519 value="false" 520 <?php checked( $navigation['navigation'], 'false' ); ?>> False 521 </label> 522 </li> 523 </ul> 524 </td> 525 </tr> 526 </tbody> 527 </table> 528 529 <div class="<?php echo ($navigation['navigation'] == 'false' ? 'hiddenData' : '' ) ?>"> 530 <table class="autoPlaySettings"> 531 <tr> 532 <td> 533 <label for="nextEl">nextEl</label> 534 </td> 535 <td> 536 <span>String with CSS selector or HTML element of the element that will work like "next" button after click on it</span> 537 <input 538 id="nextEl" 539 name="<?php echo $this->meta_prefix.'setting_navigation[nextEl]'; ?>" 540 type="text" 541 value="<?php echo $navigation['nextEl']; ?>"> 542 </td> 543 </tr> 544 <tr> 545 <td> 546 <label for="prevEl">prevEl</label> 547 </td> 548 <td> 549 <span>String with CSS selector or HTML element of the element that will work like "prev" button after click on it</span> 550 <input 551 id="prevEl" 552 name="<?php echo $this->meta_prefix.'setting_navigation[prevEl]'; ?>" 553 type="text" 554 value="<?php echo $navigation['prevEl']; ?>"> 555 </td> 556 </tr> 557 <tr> 558 <td> 559 <label for="disabledClass">disabledClass</label> 560 </td> 561 <td> 562 <span>CSS class name added to navigation button when it becomes disabled</span> 563 <input 564 id="disabledClass" 565 name="<?php echo $this->meta_prefix.'setting_navigation[disabledClass]'; ?>" 566 type="text" 567 value="<?php echo $navigation['disabledClass']; ?>"> 568 </td> 569 </tr> 570 <tr> 571 <td> 572 <label for="hiddenClass">hiddenClass</label> 573 </td> 574 <td> 575 <span>CSS class name added to navigation button when it becomes hidden</span> 576 <input 577 id="hiddenClass" 578 name="<?php echo $this->meta_prefix.'setting_navigation[hiddenClass]'; ?>" 579 type="text" 580 value="<?php echo $navigation['hiddenClass']; ?>"> 581 </td> 582 </tr> 583 </table> 584 </div> 585 </div> 136 <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/parameters-meta.php' ); ?> 137 <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/autoplay-meta.php' ); ?> 138 <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/pagination-meta.php' ); ?> 139 <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/navigation-meta.php' ); ?> 140 <?php include_once( plugin_dir_path( __FILE__ ) . '/metabox/carousel-meta.php' ); ?> 586 141 </div> 142 143 </div> 144 <div class="footerRight"> 145 <ul class="dtbl"> 146 <li class="documentation">Documentation: <a href="https://idangero.us/swiper/" target="_blank">https://idangero.us/swiper/</a></li> 147 <li class="text-right"> 148 <a href="#" class="saveAll button button-primary button-large"> 149 <span class="dashicons dashicons-admin-tools"></span> 150 Save 151 </a> 152 </li> 153 </ul> 587 154 </div> 588 155 589 156 <?php 590 157 } 591 592 593 158 594 159 public function render_metabox_shortcode( $post ) { … … 596 161 wp_nonce_field( $this->meta_prefix.'nonce_action', $this->meta_prefix.'nonce' ); ?> 597 162 598 <input 599 type="text" 600 onfocus="this.select();" 601 readonly="readonly" 602 value="[swiper-js-slider id=<?php echo $post->ID ?>]" 603 class="large-text code"> 604 163 <div class="shortcodeWrap"> 164 <h4>Copy & Paste For Post & Pages.</h4> 165 <input 166 type="text" 167 readonly="readonly" 168 value="[swiper-js-slider id=<?php echo $post->ID ?>]" 169 class="large-text code"> 170 <a href="#" class="copyData">Copy to clipboard</a> 171 </div> 172 173 <div class="shortcodeWrap"> 174 <h4>For Custom Template Php Files.</h4> 175 <input 176 type="text" 177 readonly="readonly" 178 value='<?php echo do_shortcode("[swiper-js-slider id=<?php echo $post->ID ?>]"); ?>' 179 class="large-text code"> 180 <a href="#" class="copyData">Copy to clipboard</a> 181 </div> 605 182 <?php 606 183 } … … 638 215 } 639 216 640 /* OK, it's safe for us to save the data now. */ 641 642 643 // Check if $_POST field(s) are available 644 645 // Sanitize the user input. 646 function s_j_s_sanitize_text_or_array_field($array_or_string) { 647 if( is_string($array_or_string) ){ 648 $array_or_string = sanitize_text_field($array_or_string); 649 }elseif( is_array($array_or_string) ){ 650 foreach ( $array_or_string as $key => &$value ) { 651 if ( is_array( $value ) ) { 652 $value = s_j_s_sanitize_text_or_array_field($value); 653 } 654 else { 655 $value = sanitize_text_field( $value ); 656 } 657 } 658 } 659 660 return $array_or_string; 661 } 217 /* OK, it's safe for us to save the data now. */ 662 218 663 219 // Update the meta field. 664 665 if(isset($_POST[$this->meta_prefix.'setting_autoplay'])) { 666 $autoplayData = $_POST[$this->meta_prefix.'setting_autoplay']; 667 update_post_meta($post_id, $this->meta_prefix.'setting_autoplay', s_j_s_sanitize_text_or_array_field($autoplayData)); 220 $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_general'); 221 $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_autoplay'); 222 $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_pagination'); 223 $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'setting_navigation'); 224 $this->s_j_s_updatePostMeta($post_id, $this->meta_prefix, 'gallery_id'); 225 } 226 227 function s_j_s_sanitize_text_or_array_field($array_or_string) { 228 if( is_string($array_or_string) ){ 229 $array_or_string = sanitize_text_field($array_or_string); 230 }elseif( is_array($array_or_string) ){ 231 foreach ( $array_or_string as $key => &$value ) { 232 if ( is_array( $value ) ) { 233 $value = s_j_s_sanitize_text_or_array_field($value); 234 } 235 else { 236 $value = sanitize_text_field( $value ); 237 } 238 } 239 } 240 241 return $array_or_string; 242 } 243 244 function s_j_s_updatePostMeta($id, $prefix, $name){ 245 if(isset($_POST[$prefix.$name])) { 246 $allData = $_POST[$prefix.$name]; 247 update_post_meta($id, $prefix.$name, $this->s_j_s_sanitize_text_or_array_field($allData)); 668 248 } else { 669 delete_post_meta($post_id, $this->meta_prefix.'setting_autoplay'); 670 } 671 672 if(isset($_POST[$this->meta_prefix.'setting_pagination'])) { 673 $paginationData = $_POST[$this->meta_prefix.'setting_pagination']; 674 update_post_meta($post_id, $this->meta_prefix.'setting_pagination', s_j_s_sanitize_text_or_array_field($paginationData)); 675 } else { 676 delete_post_meta($post_id, $this->meta_prefix.'setting_pagination'); 677 } 678 679 if(isset($_POST[$this->meta_prefix.'setting_navigation'])) { 680 $navigationData = $_POST[$this->meta_prefix.'setting_navigation']; 681 update_post_meta($post_id, $this->meta_prefix.'setting_navigation', s_j_s_sanitize_text_or_array_field($navigationData)); 682 } else { 683 delete_post_meta($post_id, $this->meta_prefix.'setting_navigation'); 684 } 685 686 if(isset($_POST[$this->meta_prefix.'gallery_id'])) { 687 $galleryData = $_POST[$this->meta_prefix.'gallery_id']; 688 update_post_meta($post_id, $this->meta_prefix.'gallery_id', s_j_s_sanitize_text_or_array_field($galleryData)); 689 } else { 690 delete_post_meta($post_id, $this->meta_prefix.'gallery_id'); 691 } 249 delete_post_meta($id, $prefix.$name); 250 } 692 251 } 693 252 }
Note: See TracChangeset
for help on using the changeset viewer.