Slide Anything – Responsive Content / HTML Slider and Carousel - Version 2.1.20

Version Description

  • Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.

=

Download this release

Release Info

Developer simonpedge
Plugin Icon 128x128 Slide Anything – Responsive Content / HTML Slider and Carousel
Version 2.1.20
Comparing to
See all releases

Code changes from version 2.1.19 to 2.1.20

Files changed (3) hide show
  1. php/slide-anything-frontend.php +203 -208
  2. readme.txt +14 -4
  3. slide-anything.php +1 -1
php/slide-anything-frontend.php CHANGED
@@ -458,229 +458,224 @@ function slide_anything_shortcode($atts) {
458
 
459
 
460
  // ### GENERATE JQUERY CODE FOR THE OWL CAROUSEL SLIDER ###
461
- if (wp_script_is('jquery', 'done')) { // Only generate JQuery code if JQuery has been loaded
462
- if (($slide_data['items_width1'] == 1) && ($slide_data['items_width2'] == 1) && ($slide_data['items_width3'] == 1) &&
463
- ($slide_data['items_width4'] == 1) && ($slide_data['items_width5'] == 1) && ($slide_data['items_width6'] == 1)) {
464
- $single_item = 1;
465
- } else {
466
- $single_item = 0;
467
- }
468
- $output .= "<script type='text/javascript'>\n";
469
- if ($slide_data['sa_window_onload'] == '1') {
470
- $output .= " jQuery(window).load(function() {\n";
471
- } else {
472
- $output .= " jQuery(document).ready(function() {\n";
473
- }
474
 
475
- // JQUERY CODE FOR OWN CAROUSEL
476
- $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').owlCarousel({\n";
477
- if ($single_item == 1) {
478
- $output .= " items : 1,\n";
479
- if (($slide_data['transition'] == 'Fade') || ($slide_data['transition'] == 'fade')) {
480
- $output .= " animateOut : 'fadeOut',\n";
481
- } elseif (($slide_data['transition'] == 'Slide Down') || ($slide_data['transition'] == 'goDown')) {
482
- $output .= " animateOut : 'slideOutDown',\n";
483
- $output .= " animateIn : 'fadeIn',\n";
484
- } elseif ($slide_data['transition'] == 'Zoom In') {
485
- $output .= " animateOut : 'fadeOut',\n";
486
- $output .= " animateIn : 'zoomIn',\n";
487
- } elseif ($slide_data['transition'] == 'Zoom Out') {
488
- $output .= " animateOut : 'zoomOut',\n";
489
- $output .= " animateIn : 'fadeIn',\n";
490
- } elseif ($slide_data['transition'] == 'Flip Out X') {
491
- $output .= " animateOut : 'flipOutX',\n";
492
- $output .= " animateIn : 'fadeIn',\n";
493
- } elseif ($slide_data['transition'] == 'Flip Out Y') {
494
- $output .= " animateOut : 'flipOutY',\n";
495
- $output .= " animateIn : 'fadeIn',\n";
496
- } elseif ($slide_data['transition'] == 'Rotate Left') {
497
- $output .= " animateOut : 'rotateOutDownLeft',\n";
498
- $output .= " animateIn : 'fadeIn',\n";
499
- } elseif ($slide_data['transition'] == 'Rotate Right') {
500
- $output .= " animateOut : 'rotateOutDownRight',\n";
501
- $output .= " animateIn : 'fadeIn',\n";
502
- } elseif ($slide_data['transition'] == 'Bounce Out') {
503
- $output .= " animateOut : 'bounceOut',\n";
504
- $output .= " animateIn : 'fadeIn',\n";
505
- } elseif ($slide_data['transition'] == 'Roll Out') {
506
- $output .= " animateOut : 'rollOut',\n";
507
- $output .= " animateIn : 'fadeIn',\n";
508
- }
509
- $output .= " smartSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
510
- } else {
511
- $output .= " responsive:{\n";
512
- $output .= " 0:{ items:".esc_attr($slide_data['items_width1'])." },\n";
513
- $output .= " 480:{ items:".esc_attr($slide_data['items_width2'])." },\n";
514
- $output .= " 768:{ items:".esc_attr($slide_data['items_width3'])." },\n";
515
- $output .= " 980:{ items:".esc_attr($slide_data['items_width4'])." },\n";
516
- $output .= " 1200:{ items:".esc_attr($slide_data['items_width5'])." },\n";
517
- $output .= " 1500:{ items:".esc_attr($slide_data['items_width6'])." }\n";
518
- $output .= " },\n";
519
- }
520
- if ($slide_data['slide_duration'] == 0) {
521
- $output .= " autoplay : false,\n";
522
- $output .= " autoplayHoverPause : false,\n";
523
- } else {
524
- $output .= " autoplay : true,\n";
525
- $output .= " autoplayTimeout : ".esc_attr($slide_data['slide_duration']).",\n";
526
- $output .= " autoplayHoverPause : ".esc_attr($slide_data['stop_hover']).",\n";
527
  }
528
  $output .= " smartSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
529
- $output .= " fluidSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
530
- $output .= " autoplaySpeed : ".esc_attr($slide_data['slide_transition']).",\n";
531
- $output .= " navSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
532
- $output .= " dotsSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
533
- $output .= " loop : ".esc_attr($slide_data['loop_slider']).",\n";
534
- $output .= " nav : ".esc_attr($slide_data['nav_arrows']).",\n";
535
- $output .= " navText : ['',''],\n";
536
- $output .= " dots : ".esc_attr($slide_data['pagination']).",\n";
537
- $output .= " responsiveRefreshRate : 200,\n";
538
- if ($slide_data['slide_by'] == 'page') {
539
- $output .= " slideBy : 'page',\n";
540
- } else {
541
- $output .= " slideBy : ".esc_attr($slide_data['slide_by']).",\n";
542
- }
543
- $output .= " mergeFit : true,\n";
544
- //$output .= " URLhashListener : true,\n";
545
- $output .= " autoHeight : ".esc_attr($slide_data['auto_height']).",\n";
546
- if ($slide_data['lazy_load_images'] == '1') {
547
- $output .= " lazyLoad : true,\n";
548
- $output .= " lazyLoadEager: 1,\n";
549
- }
550
- $output .= " mouseDrag : ".esc_attr($slide_data['mouse_drag']).",\n";
551
- $output .= " touchDrag : ".esc_attr($slide_data['touch_drag'])."\n";
552
- $output .= " });\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
553
 
554
- // MAKE SLIDER VISIBLE (AFTER 'WINDOW ONLOAD' OR 'DOCUMENT READY' EVENT)
555
- $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').css('visibility', 'visible');\n";
556
 
557
- // JAVASCRIPT 'WINDOW RESIZE' EVENT TO SET CSS 'min-height' OF SLIDES WITHIN THIS SLIDER
558
- $slide_min_height = $slide_data['slide_min_height_perc'];
559
- if (strpos($slide_min_height, 'px') !== false) {
560
- $slide_min_height = 0;
561
- }
562
- if (($slide_min_height != '') && ($slide_min_height != '0')) {
563
- $output .= " sa_resize_".esc_attr($slide_data['css_id'])."();\n"; // initial call of resize function
564
- $output .= " window.addEventListener('resize', sa_resize_".esc_attr($slide_data['css_id']).");\n"; // create resize event
565
- // RESIZE EVENT FUNCTION (to set slide CSS 'min-heigh')
566
- $output .= " function sa_resize_".esc_attr($slide_data['css_id'])."() {\n";
567
- // get slide min height setting
568
- $output .= " var min_height = '".$slide_min_height."';\n";
569
- // get window width
570
- $output .= " var win_width = jQuery(window).width();\n";
571
- $output .= " var slider_width = jQuery('#".esc_attr($slide_data['css_id'])."').width();\n";
572
- // calculate slide width according to window width & number of slides
573
- $output .= " if (win_width < 480) {\n";
574
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width1']).";\n";
575
- $output .= " } else if (win_width < 768) {\n";
576
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width2']).";\n";
577
- $output .= " } else if (win_width < 980) {\n";
578
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width3']).";\n";
579
- $output .= " } else if (win_width < 1200) {\n";
580
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width4']).";\n";
581
- $output .= " } else if (win_width < 1500) {\n";
582
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width5']).";\n";
583
- $output .= " } else {\n";
584
- $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width6']).";\n";
585
- $output .= " }\n";
586
- $output .= " slide_width = Math.round(slide_width);\n";
587
- // calculate CSS 'min-height' using the captured 'min-height' data settings for this slider
588
- $output .= " var slide_height = '0';\n";
589
- $output .= " if (min_height == 'aspect43') {\n";
590
- $output .= " slide_height = (slide_width / 4) * 3;";
591
- $output .= " slide_height = Math.round(slide_height);\n";
592
- $output .= " } else if (min_height == 'aspect169') {\n";
593
- $output .= " slide_height = (slide_width / 16) * 9;";
594
- $output .= " slide_height = Math.round(slide_height);\n";
595
- $output .= " } else {\n";
596
- $output .= " slide_height = (slide_width / 100) * min_height;";
597
- $output .= " slide_height = Math.round(slide_height);\n";
598
- $output .= " }\n";
599
- // set the slide 'min-height' css value
600
- $output .= " jQuery('#".esc_attr($slide_data['css_id'])." .owl-item .sa_hover_container').css('min-height', slide_height+'px');\n";
601
- $output .= " }\n";
602
- }
603
- $output .= " });\n";
604
- $output .= "</script>\n";
605
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
 
607
 
608
 
609
  // ### GENERATE JQUERY CODE FOR THE MAGNIFIC POPUP ###
610
- if (wp_script_is('jquery', 'done')) { // Only generate JQuery code if JQuery has been loaded
611
- if (($sa_pro_version) && ($lightbox_count > 0)) {
612
- $output .= "<script type='text/javascript'>\n";
613
- $output .= "jQuery(document).ready(function() {\n";
614
- $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup({\n";
615
- $output .= " items: [\n";
616
- $count = 0;
617
- for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
618
- // LOOP THROUGH EACH SLIDE
619
- if (($slide_data["slide".$i."_popup_type"] == 'IMAGE') && ($slide_data["slide".$i."_popup_image"] != '')) {
620
- // SLIDE CONTAINS AN IMAGE POPUP
621
- $img_url = $slide_data["slide".$i."_popup_image"];
622
- $img_title = $slide_data["slide".$i."_popup_imagetitle"];
623
- if ($img_title != '') {
624
- $output .= " { src: '".esc_attr($img_url)."', title: '".esc_attr($img_title)."' }";
625
- } else {
626
- $output .= " { src: '".esc_attr($img_url)."' }";
627
- }
628
- $count++;
629
- if ($count < $lightbox_count) { $output .= ",\n"; }
630
- else { $output .= "\n"; }
631
- }
632
- if (($slide_data["slide".$i."_popup_type"] == 'VIDEO') && ($slide_data["slide".$i."_popup_video_id"] != '')) {
633
- // SLIDE CONTAINS A VIDEO POPUP
634
- $video_id = $slide_data["slide".$i."_popup_video_id"];
635
- $video_type = $slide_data["slide".$i."_popup_video_type"];
636
- if ($video_type == 'youtube') {
637
- $video_url = "http://www.youtube.com/watch?v=".$video_id;
638
- } elseif ($video_type == 'vimeo') {
639
- $video_url = "http://vimeo.com/".$video_id;
640
- }
641
- $output .= " { src: '".esc_attr($video_url)."', type: 'iframe' }";
642
- $count++;
643
- if ($count < $lightbox_count) { $output .= ",\n"; }
644
- else { $output .= "\n"; }
645
  }
646
- if ($slide_data["slide".$i."_popup_type"] == 'HTML') {
647
- // SLIDE CONTAINS A HTML POPUP
648
- $popup_css_id = "#".$slide_data["slide".$i."_popup_css_id"];
649
- $output .= " { src: '".esc_attr($popup_css_id)."', type: 'inline' }";
650
- $count++;
651
- if ($count < $lightbox_count) { $output .= ",\n"; }
652
- else { $output .= "\n"; }
 
 
 
 
 
653
  }
 
 
 
 
654
  }
655
- $output .= " ],\n";
656
- $output .= " gallery: { enabled: true, tCounter: '' },\n";
657
- $output .= " mainClass: 'sa_popup',\n";
658
- $output .= " closeBtnInside: true,\n";
659
- $output .= " fixedContentPos: true,\n";
660
- if ($slide_data['slide_duration'] != 0) {
661
- $output .= " callbacks: {\n";
662
- $output .= " open: function() {\n";
663
- $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('stop.owl.autoplay');\n";
664
- $output .= " },\n";
665
- $output .= " close: function() {\n";
666
- $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('play.owl.autoplay');\n";
667
- $output .= " }\n";
668
- $output .= " },\n";
669
  }
670
- $output .= " type: 'image'\n";
671
- $output .= " });\n";
672
- $output .= "});\n";
673
-
674
- // JAVASCRIPT FUNCTION WHICH OPENS THIS MAGNIFIC POPUP ON A SPECIFIED SLIDE
675
- $output .= "function ".$lightbox_function."(slide) {\n";
676
- $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('open');\n";
677
- $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('goTo', slide-1);\n";
678
- $output .= "}\n";
679
- $output .= "</script>\n";
680
-
681
- // DIV CONTAINER WHICH HOLDS THIS MAGNIFIC POPUP CONTENT (HIDDEN)
682
- $output .= "<div id='".$lightbox_gallery_id."' style='display:none;'></div>\n";
683
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  }
685
  }
686
  }
458
 
459
 
460
  // ### GENERATE JQUERY CODE FOR THE OWL CAROUSEL SLIDER ###
461
+ if (($slide_data['items_width1'] == 1) && ($slide_data['items_width2'] == 1) && ($slide_data['items_width3'] == 1) &&
462
+ ($slide_data['items_width4'] == 1) && ($slide_data['items_width5'] == 1) && ($slide_data['items_width6'] == 1)) {
463
+ $single_item = 1;
464
+ } else {
465
+ $single_item = 0;
466
+ }
467
+ $output .= "<script type='text/javascript'>\n";
468
+ if ($slide_data['sa_window_onload'] == '1') {
469
+ $output .= " jQuery(window).load(function() {\n";
470
+ } else {
471
+ $output .= " jQuery(document).ready(function() {\n";
472
+ }
 
473
 
474
+ // JQUERY CODE FOR OWN CAROUSEL
475
+ $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').owlCarousel({\n";
476
+ if ($single_item == 1) {
477
+ $output .= " items : 1,\n";
478
+ if (($slide_data['transition'] == 'Fade') || ($slide_data['transition'] == 'fade')) {
479
+ $output .= " animateOut : 'fadeOut',\n";
480
+ } elseif (($slide_data['transition'] == 'Slide Down') || ($slide_data['transition'] == 'goDown')) {
481
+ $output .= " animateOut : 'slideOutDown',\n";
482
+ $output .= " animateIn : 'fadeIn',\n";
483
+ } elseif ($slide_data['transition'] == 'Zoom In') {
484
+ $output .= " animateOut : 'fadeOut',\n";
485
+ $output .= " animateIn : 'zoomIn',\n";
486
+ } elseif ($slide_data['transition'] == 'Zoom Out') {
487
+ $output .= " animateOut : 'zoomOut',\n";
488
+ $output .= " animateIn : 'fadeIn',\n";
489
+ } elseif ($slide_data['transition'] == 'Flip Out X') {
490
+ $output .= " animateOut : 'flipOutX',\n";
491
+ $output .= " animateIn : 'fadeIn',\n";
492
+ } elseif ($slide_data['transition'] == 'Flip Out Y') {
493
+ $output .= " animateOut : 'flipOutY',\n";
494
+ $output .= " animateIn : 'fadeIn',\n";
495
+ } elseif ($slide_data['transition'] == 'Rotate Left') {
496
+ $output .= " animateOut : 'rotateOutDownLeft',\n";
497
+ $output .= " animateIn : 'fadeIn',\n";
498
+ } elseif ($slide_data['transition'] == 'Rotate Right') {
499
+ $output .= " animateOut : 'rotateOutDownRight',\n";
500
+ $output .= " animateIn : 'fadeIn',\n";
501
+ } elseif ($slide_data['transition'] == 'Bounce Out') {
502
+ $output .= " animateOut : 'bounceOut',\n";
503
+ $output .= " animateIn : 'fadeIn',\n";
504
+ } elseif ($slide_data['transition'] == 'Roll Out') {
505
+ $output .= " animateOut : 'rollOut',\n";
506
+ $output .= " animateIn : 'fadeIn',\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  }
508
  $output .= " smartSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
509
+ } else {
510
+ $output .= " responsive:{\n";
511
+ $output .= " 0:{ items:".esc_attr($slide_data['items_width1'])." },\n";
512
+ $output .= " 480:{ items:".esc_attr($slide_data['items_width2'])." },\n";
513
+ $output .= " 768:{ items:".esc_attr($slide_data['items_width3'])." },\n";
514
+ $output .= " 980:{ items:".esc_attr($slide_data['items_width4'])." },\n";
515
+ $output .= " 1200:{ items:".esc_attr($slide_data['items_width5'])." },\n";
516
+ $output .= " 1500:{ items:".esc_attr($slide_data['items_width6'])." }\n";
517
+ $output .= " },\n";
518
+ }
519
+ if ($slide_data['slide_duration'] == 0) {
520
+ $output .= " autoplay : false,\n";
521
+ $output .= " autoplayHoverPause : false,\n";
522
+ } else {
523
+ $output .= " autoplay : true,\n";
524
+ $output .= " autoplayTimeout : ".esc_attr($slide_data['slide_duration']).",\n";
525
+ $output .= " autoplayHoverPause : ".esc_attr($slide_data['stop_hover']).",\n";
526
+ }
527
+ $output .= " smartSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
528
+ $output .= " fluidSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
529
+ $output .= " autoplaySpeed : ".esc_attr($slide_data['slide_transition']).",\n";
530
+ $output .= " navSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
531
+ $output .= " dotsSpeed : ".esc_attr($slide_data['slide_transition']).",\n";
532
+ $output .= " loop : ".esc_attr($slide_data['loop_slider']).",\n";
533
+ $output .= " nav : ".esc_attr($slide_data['nav_arrows']).",\n";
534
+ $output .= " navText : ['',''],\n";
535
+ $output .= " dots : ".esc_attr($slide_data['pagination']).",\n";
536
+ $output .= " responsiveRefreshRate : 200,\n";
537
+ if ($slide_data['slide_by'] == 'page') {
538
+ $output .= " slideBy : 'page',\n";
539
+ } else {
540
+ $output .= " slideBy : ".esc_attr($slide_data['slide_by']).",\n";
541
+ }
542
+ $output .= " mergeFit : true,\n";
543
+ $output .= " autoHeight : ".esc_attr($slide_data['auto_height']).",\n";
544
+ if ($slide_data['lazy_load_images'] == '1') {
545
+ $output .= " lazyLoad : true,\n";
546
+ $output .= " lazyLoadEager: 1,\n";
547
+ }
548
+ $output .= " mouseDrag : ".esc_attr($slide_data['mouse_drag']).",\n";
549
+ $output .= " touchDrag : ".esc_attr($slide_data['touch_drag'])."\n";
550
+ $output .= " });\n";
551
 
552
+ // MAKE SLIDER VISIBLE (AFTER 'WINDOW ONLOAD' OR 'DOCUMENT READY' EVENT)
553
+ $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').css('visibility', 'visible');\n";
554
 
555
+ // JAVASCRIPT 'WINDOW RESIZE' EVENT TO SET CSS 'min-height' OF SLIDES WITHIN THIS SLIDER
556
+ $slide_min_height = $slide_data['slide_min_height_perc'];
557
+ if (strpos($slide_min_height, 'px') !== false) {
558
+ $slide_min_height = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  }
560
+ if (($slide_min_height != '') && ($slide_min_height != '0')) {
561
+ $output .= " sa_resize_".esc_attr($slide_data['css_id'])."();\n"; // initial call of resize function
562
+ $output .= " window.addEventListener('resize', sa_resize_".esc_attr($slide_data['css_id']).");\n"; // create resize event
563
+ // RESIZE EVENT FUNCTION (to set slide CSS 'min-heigh')
564
+ $output .= " function sa_resize_".esc_attr($slide_data['css_id'])."() {\n";
565
+ // get slide min height setting
566
+ $output .= " var min_height = '".$slide_min_height."';\n";
567
+ // get window width
568
+ $output .= " var win_width = jQuery(window).width();\n";
569
+ $output .= " var slider_width = jQuery('#".esc_attr($slide_data['css_id'])."').width();\n";
570
+ // calculate slide width according to window width & number of slides
571
+ $output .= " if (win_width < 480) {\n";
572
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width1']).";\n";
573
+ $output .= " } else if (win_width < 768) {\n";
574
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width2']).";\n";
575
+ $output .= " } else if (win_width < 980) {\n";
576
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width3']).";\n";
577
+ $output .= " } else if (win_width < 1200) {\n";
578
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width4']).";\n";
579
+ $output .= " } else if (win_width < 1500) {\n";
580
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width5']).";\n";
581
+ $output .= " } else {\n";
582
+ $output .= " var slide_width = slider_width / ".esc_attr($slide_data['items_width6']).";\n";
583
+ $output .= " }\n";
584
+ $output .= " slide_width = Math.round(slide_width);\n";
585
+ // calculate CSS 'min-height' using the captured 'min-height' data settings for this slider
586
+ $output .= " var slide_height = '0';\n";
587
+ $output .= " if (min_height == 'aspect43') {\n";
588
+ $output .= " slide_height = (slide_width / 4) * 3;";
589
+ $output .= " slide_height = Math.round(slide_height);\n";
590
+ $output .= " } else if (min_height == 'aspect169') {\n";
591
+ $output .= " slide_height = (slide_width / 16) * 9;";
592
+ $output .= " slide_height = Math.round(slide_height);\n";
593
+ $output .= " } else {\n";
594
+ $output .= " slide_height = (slide_width / 100) * min_height;";
595
+ $output .= " slide_height = Math.round(slide_height);\n";
596
+ $output .= " }\n";
597
+ // set the slide 'min-height' css value
598
+ $output .= " jQuery('#".esc_attr($slide_data['css_id'])." .owl-item .sa_hover_container').css('min-height', slide_height+'px');\n";
599
+ $output .= " }\n";
600
+ }
601
+ $output .= " });\n";
602
+ $output .= "</script>\n";
603
 
604
 
605
 
606
  // ### GENERATE JQUERY CODE FOR THE MAGNIFIC POPUP ###
607
+ if (($sa_pro_version) && ($lightbox_count > 0)) {
608
+ $output .= "<script type='text/javascript'>\n";
609
+ $output .= "jQuery(document).ready(function() {\n";
610
+ $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup({\n";
611
+ $output .= " items: [\n";
612
+ $count = 0;
613
+ for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
614
+ // LOOP THROUGH EACH SLIDE
615
+ if (($slide_data["slide".$i."_popup_type"] == 'IMAGE') && ($slide_data["slide".$i."_popup_image"] != '')) {
616
+ // SLIDE CONTAINS AN IMAGE POPUP
617
+ $img_url = $slide_data["slide".$i."_popup_image"];
618
+ $img_title = $slide_data["slide".$i."_popup_imagetitle"];
619
+ if ($img_title != '') {
620
+ $output .= " { src: '".esc_attr($img_url)."', title: '".esc_attr($img_title)."' }";
621
+ } else {
622
+ $output .= " { src: '".esc_attr($img_url)."' }";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  }
624
+ $count++;
625
+ if ($count < $lightbox_count) { $output .= ",\n"; }
626
+ else { $output .= "\n"; }
627
+ }
628
+ if (($slide_data["slide".$i."_popup_type"] == 'VIDEO') && ($slide_data["slide".$i."_popup_video_id"] != '')) {
629
+ // SLIDE CONTAINS A VIDEO POPUP
630
+ $video_id = $slide_data["slide".$i."_popup_video_id"];
631
+ $video_type = $slide_data["slide".$i."_popup_video_type"];
632
+ if ($video_type == 'youtube') {
633
+ $video_url = "http://www.youtube.com/watch?v=".$video_id;
634
+ } elseif ($video_type == 'vimeo') {
635
+ $video_url = "http://vimeo.com/".$video_id;
636
  }
637
+ $output .= " { src: '".esc_attr($video_url)."', type: 'iframe' }";
638
+ $count++;
639
+ if ($count < $lightbox_count) { $output .= ",\n"; }
640
+ else { $output .= "\n"; }
641
  }
642
+ if ($slide_data["slide".$i."_popup_type"] == 'HTML') {
643
+ // SLIDE CONTAINS A HTML POPUP
644
+ $popup_css_id = "#".$slide_data["slide".$i."_popup_css_id"];
645
+ $output .= " { src: '".esc_attr($popup_css_id)."', type: 'inline' }";
646
+ $count++;
647
+ if ($count < $lightbox_count) { $output .= ",\n"; }
648
+ else { $output .= "\n"; }
 
 
 
 
 
 
 
649
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
650
  }
651
+ $output .= " ],\n";
652
+ $output .= " gallery: { enabled: true, tCounter: '' },\n";
653
+ $output .= " mainClass: 'sa_popup',\n";
654
+ $output .= " closeBtnInside: true,\n";
655
+ $output .= " fixedContentPos: true,\n";
656
+ if ($slide_data['slide_duration'] != 0) {
657
+ $output .= " callbacks: {\n";
658
+ $output .= " open: function() {\n";
659
+ $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('stop.owl.autoplay');\n";
660
+ $output .= " },\n";
661
+ $output .= " close: function() {\n";
662
+ $output .= " jQuery('#".esc_attr($slide_data['css_id'])."').trigger('play.owl.autoplay');\n";
663
+ $output .= " }\n";
664
+ $output .= " },\n";
665
+ }
666
+ $output .= " type: 'image'\n";
667
+ $output .= " });\n";
668
+ $output .= "});\n";
669
+
670
+ // JAVASCRIPT FUNCTION WHICH OPENS THIS MAGNIFIC POPUP ON A SPECIFIED SLIDE
671
+ $output .= "function ".$lightbox_function."(slide) {\n";
672
+ $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('open');\n";
673
+ $output .= " jQuery('#".$lightbox_gallery_id."').magnificPopup('goTo', slide-1);\n";
674
+ $output .= "}\n";
675
+ $output .= "</script>\n";
676
+
677
+ // DIV CONTAINER WHICH HOLDS THIS MAGNIFIC POPUP CONTENT (HIDDEN)
678
+ $output .= "<div id='".$lightbox_gallery_id."' style='display:none;'></div>\n";
679
  }
680
  }
681
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: simonpedge
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RP7JLGK6VT252
4
  Tags: slider, carousel, content slider, responsive slider, html slider, owl carousel
5
  Requires at least: 4.0
6
- Tested up to: 4.9.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -51,7 +51,7 @@ You will now see the `Sliders` menu in your WordPress admin panel.
51
 
52
  == Frequently Asked Questions ==
53
 
54
- = How do I insert `Slide Anything` sliders into my WordPress pages or posts? =
55
 
56
  There are two ways to do this. If you are using the visual editor to edit a page or post, you will see a `Slide Anything Sliders` button/icon in the toolbar of the editor. Click this button and a popup will be displayed containing a list of sliders that you have created. Select the title of a slider within this list and click `OK` to insert the shortcode for the selected slider into your page or post content.
57
 
@@ -71,7 +71,7 @@ To set a slide background image, click the `Set Image` button. The `Background S
71
 
72
  The `Min Height` setting (within the `Slider Style` box), is often used in conjunction with defining slide backgrounds, as this setting controls how much of the slide background is visible if the slide contains no (foreground) content.
73
 
74
- = How do I use the `Slider Style` settings? =
75
 
76
  At the top of this box, which appears on the right-hand side when editing a slider, you can set and copy the CSS `ID` for the slider. This is useful for developers who are familiar with CSS coding, and this CSS `ID` can be used to create custom styles for your slider within your theme or child-theme's style/CSS file.
77
 
@@ -79,6 +79,10 @@ The `Padding (pixels)` settings are used to define the amount of padding space a
79
 
80
  The `SLIDE STYLE` settings are the style settings for each individual slide with the slider/carousel. Here you can define the minimum height each slide and also the padding space around each slide.
81
 
 
 
 
 
82
  == Screenshots ==
83
 
84
  1. The Create/Edit slider page within the WordPress Dashboard - this is where you define the settings and create the slides for your `Slide Anything` slider or carousel.
@@ -245,6 +249,9 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
245
  = 2.1.19 =
246
  * Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
247
 
 
 
 
248
  == Upgrade Notice ==
249
 
250
  = 1.0 =
@@ -403,4 +410,7 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
403
  * Bug Fix - There was an issue on mobile phones when autoplay is disabled, and when you swipe to change current slide then autoplay starts up. This has now been fixed.
404
 
405
  = 2.1.19 =
406
- * Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
 
 
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RP7JLGK6VT252
4
  Tags: slider, carousel, content slider, responsive slider, html slider, owl carousel
5
  Requires at least: 4.0
6
+ Tested up to: 5.0
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
51
 
52
  == Frequently Asked Questions ==
53
 
54
+ = How do I insert 'Slide Anything' sliders into my WordPress pages or posts? =
55
 
56
  There are two ways to do this. If you are using the visual editor to edit a page or post, you will see a `Slide Anything Sliders` button/icon in the toolbar of the editor. Click this button and a popup will be displayed containing a list of sliders that you have created. Select the title of a slider within this list and click `OK` to insert the shortcode for the selected slider into your page or post content.
57
 
71
 
72
  The `Min Height` setting (within the `Slider Style` box), is often used in conjunction with defining slide backgrounds, as this setting controls how much of the slide background is visible if the slide contains no (foreground) content.
73
 
74
+ = How do I use the 'Slider Style' settings? =
75
 
76
  At the top of this box, which appears on the right-hand side when editing a slider, you can set and copy the CSS `ID` for the slider. This is useful for developers who are familiar with CSS coding, and this CSS `ID` can be used to create custom styles for your slider within your theme or child-theme's style/CSS file.
77
 
79
 
80
  The `SLIDE STYLE` settings are the style settings for each individual slide with the slider/carousel. Here you can define the minimum height each slide and also the padding space around each slide.
81
 
82
+ = Using 'Slide Anything' in WordPress 5.0 =
83
+
84
+ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty straight-forward. You can paste a Slide Anything shortcode into a 'Paragraph Block' or use the 'Shortcode Block'.
85
+
86
  == Screenshots ==
87
 
88
  1. The Create/Edit slider page within the WordPress Dashboard - this is where you define the settings and create the slides for your `Slide Anything` slider or carousel.
249
  = 2.1.19 =
250
  * Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
251
 
252
+ = 2.1.20 =
253
+ * Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
254
+
255
  == Upgrade Notice ==
256
 
257
  = 1.0 =
410
  * Bug Fix - There was an issue on mobile phones when autoplay is disabled, and when you swipe to change current slide then autoplay starts up. This has now been fixed.
411
 
412
  = 2.1.19 =
413
+ * Small enhancement - The Slide Anything container is now set to hidden (visibility:hidden) until all the slides have been displayed and owl-carousel JavaScript code executed, then the SA container is set to visible (visibility:visible). This presents a cleaner page loading experience without the individual slide containers (DIVS) sometimes being displayed (even for a fraction of a second) prior to slider initialisation.
414
+
415
+ = 2.1.20 =
416
+ * Bug Fix - Fixed an issue where the Slide Anything JavaScript code was not being generated with certain newer themes.
slide-anything.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wordpress.org/plugins/slide-anything/
5
  * Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
6
  * Author: Simon Edge
7
- * Version: 2.1.19
8
  * License: GPLv2 or later
9
  */
10
 
4
  * Plugin URI: https://wordpress.org/plugins/slide-anything/
5
  * Description: Slide Anything allows you to create a carousel/slider where the content for each slide can be anything you want - images, text, HTML, and even shortcodes. This plugin uses the Owl Carousel jQuery plugin, and lets you create beautiful, touch enabled, responsive carousels and sliders.
6
  * Author: Simon Edge
7
+ * Version: 2.1.20
8
  * License: GPLv2 or later
9
  */
10