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

Version Description

  • Added the option to bulk delete slides within the 'Re-Order Slides' page

=

Download this release

Release Info

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

Code changes from version 2.3.6 to 2.3.7

css/slide-anything-admin.css CHANGED
@@ -1556,8 +1556,8 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1556
  font-weight:400 !important;
1557
  font-size:16px !important;
1558
  line-height:16px !important;
1559
- background-color:#00519c !important;
1560
  color:#ffffff !important;
 
1561
  border-style:none !important;
1562
  border-radius:5px !important;
1563
  outline-color:transparent !important;
@@ -1568,7 +1568,16 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1568
  -moz-transition:all 0.3s ease-in-out;
1569
  -o-transition:all 0.3s ease-in-out;
1570
  }
1571
- #sa_reorder_slides input[type=submit]:hover {
 
 
 
 
 
 
 
 
 
1572
  background-color:#000000 !important;
1573
  }
1574
  #sa_reorder_slides #sar_no_sliders_found {
@@ -1616,6 +1625,7 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1616
  box-sizing:border-box !important;
1617
  }
1618
  #sa_reorder_slides #sar_sortable li {
 
1619
  width:100% !important;
1620
  clear:both !important;
1621
  margin:0px 0px 5px !important;
@@ -1662,6 +1672,22 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1662
  line-height:16px !important;
1663
  color:#000000 !important;
1664
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1665
  #sa_reorder_slides #sar_sortable li .sar_content .sar_slide_html {
1666
  height:96px !important;
1667
  padding:8px !important;
@@ -1701,3 +1727,14 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1701
  #sa_reorder_slides .sar_back_button:hover {
1702
  background-color:#000000 !important;
1703
  }
 
 
 
 
 
 
 
 
 
 
 
1556
  font-weight:400 !important;
1557
  font-size:16px !important;
1558
  line-height:16px !important;
 
1559
  color:#ffffff !important;
1560
+ background-color:#00519c !important;
1561
  border-style:none !important;
1562
  border-radius:5px !important;
1563
  outline-color:transparent !important;
1568
  -moz-transition:all 0.3s ease-in-out;
1569
  -o-transition:all 0.3s ease-in-out;
1570
  }
1571
+ #sa_reorder_slides #sar_update_but {
1572
+ background-color:#00519c !important;
1573
+ }
1574
+ #sa_reorder_slides #sar_delete_but {
1575
+ display:none;
1576
+ background-color:crimson !important;
1577
+ }
1578
+ #sa_reorder_slides input[type=submit]:hover,
1579
+ #sa_reorder_slides #sar_update_but:hover,
1580
+ #sa_reorder_slides #sar_delete_but:hover {
1581
  background-color:#000000 !important;
1582
  }
1583
  #sa_reorder_slides #sar_no_sliders_found {
1625
  box-sizing:border-box !important;
1626
  }
1627
  #sa_reorder_slides #sar_sortable li {
1628
+ position:relative !important;
1629
  width:100% !important;
1630
  clear:both !important;
1631
  margin:0px 0px 5px !important;
1672
  line-height:16px !important;
1673
  color:#000000 !important;
1674
  }
1675
+ #sa_reorder_slides #sar_sortable li .sar_content .sar_del_slide {
1676
+ position:absolute !important;
1677
+ top:10px !important;
1678
+ right:10px !important;
1679
+ font-weight:700 !important;
1680
+ font-size:13px !important;
1681
+ line-height:100% !important;
1682
+ color:crimson !important;
1683
+ }
1684
+ #sa_reorder_slides #sar_sortable li .sar_content .sar_del_slide input[type=checkbox] {
1685
+ margin-left:10px !important;
1686
+ width:16px !important;
1687
+ height:16px !important;
1688
+ border-color:crimson !important;
1689
+ background-color:#ffffff !important;
1690
+ }
1691
  #sa_reorder_slides #sar_sortable li .sar_content .sar_slide_html {
1692
  height:96px !important;
1693
  padding:8px !important;
1727
  #sa_reorder_slides .sar_back_button:hover {
1728
  background-color:#000000 !important;
1729
  }
1730
+ @media only screen and (max-width:479px) {
1731
+ #sa_reorder_slides > h1 { font-size:20px !important; line-height:26px !important; }
1732
+ #sa_reorder_slides #sar_slider_form div select {
1733
+ max-width:320px !important; font-size:16px !important; line-height:38px !important;
1734
+ height:38px !important; }
1735
+ #sa_reorder_slides input[type=submit] {
1736
+ padding:10px 16px !important; font-size:14px !important; line-height:14px !important; }
1737
+ #sa_reorder_slides #sar_slider_title { font-size:18px !important; line-height:26px !important; }
1738
+ #sa_reorder_slides #sar_drag_message { font-size:16px !important; line-height:22px !important; }
1739
+ #sa_reorder_slides #sar_sortable li .sar_content .sar_del_slide span { display:none !important; }
1740
+ }
js/slide-anything-admin.js CHANGED
@@ -670,7 +670,13 @@ jQuery(function() {
670
  }
671
  });
672
 
673
- // ##### JQUERY-UI SORTABLE - RE-ORDER SLIDES SUB-PAGE #####
 
 
 
 
 
 
674
  jQuery("#sar_sortable").sortable({
675
  placeholder: 'ui-state-highlight',
676
  cursor: 'move',
@@ -682,6 +688,43 @@ jQuery(function() {
682
  }
683
  });
684
  jQuery("#sar_sortable" ).disableSelection();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  })
686
 
687
 
670
  }
671
  });
672
 
673
+
674
+
675
+ // ################################
676
+ // ##### RE-ORDER SLIDES PAGE #####
677
+ // ################################
678
+
679
+ // ##### RE-ORDER SLIDES PAGE - JQUERY-UI SORTABLE ELEMENT #####
680
  jQuery("#sar_sortable").sortable({
681
  placeholder: 'ui-state-highlight',
682
  cursor: 'move',
688
  }
689
  });
690
  jQuery("#sar_sortable" ).disableSelection();
691
+
692
+ // ##### RE-ORDER SLIDES PAGE - A 'DELETE SLIDE' CHECKBOX HAS BEEN CLICKED #####
693
+ jQuery('.sar_del_checkbox').click(function(event) {
694
+ var clicked_id = event.target.id;
695
+ var del_list = '';
696
+
697
+ // loop thought all 'delete slide' checkboxes looking for ones that have been checked
698
+ jQuery('.sar_del_checkbox').each(function (index, value) {
699
+ var checkbox_id = jQuery(this).attr('id');
700
+ if (jQuery('#' + checkbox_id).is(":checked")) {
701
+ var slide_no = checkbox_id.replace("sar_del", "");
702
+ if (del_list != '') { del_list += ','; }
703
+ del_list += slide_no;
704
+ }
705
+ });
706
+
707
+ // update the hidden 'delete slides' input box in the form
708
+ document.getElementById("sar_del_slides").value = del_list;
709
+
710
+ if (del_list == '') {
711
+ document.getElementById("sar_delete_but").style.display = 'none';
712
+ document.getElementById("sar_update_but").style.display = 'inline-block';
713
+ } else {
714
+ document.getElementById("sar_delete_but").style.display = 'inline-block';
715
+ document.getElementById("sar_update_but").style.display = 'none';
716
+ }
717
+ });
718
+
719
+ // ##### RE-ORDER SLIDES PAGE - 'UPDATE ORDER' BUTTON CLICKED #####
720
+ jQuery('#sar_update_but').click(function(event) {
721
+ document.getElementById("sar_del_slides").value = '';
722
+ });
723
+
724
+ // ##### RE-ORDER SLIDES PAGE - 'DELETE SLIDES' BUTTON CLICKED #####
725
+ jQuery('#sar_delete_but').click(function(event) {
726
+ document.getElementById("sar_sort_order").value = '';
727
+ });
728
  })
729
 
730
 
php/slide-anything-admin.php CHANGED
@@ -2673,7 +2673,7 @@ function sa_reorder_slides_page() {
2673
  $slider_title = get_the_title($slider_id);
2674
 
2675
  if (isset($_POST['sar_sort_order']) && ($_POST['sar_sort_order'] != '')) {
2676
- // CHANGE THE ORDER OF SLIDE DATA FOR THE SLIDER AND RE-SAVE METADATA
2677
  $sort_order = $_POST['sar_sort_order'];
2678
  $data_in_arr = array();
2679
  $data_out_arr = array();
@@ -2684,7 +2684,7 @@ function sa_reorder_slides_page() {
2684
  foreach ($metadata as $key => $value_arr) {
2685
  $value = $value_arr[0];
2686
  for ($i = 1; $i <= $num_slides; $i++) {
2687
- $key_prefix = "sa_slide".$i;
2688
  if (strpos($key, $key_prefix) === 0) {
2689
  // metadata key starts with the key prefix ('sa_slide??')
2690
  $data_in_arr[$key] = $value;
@@ -2695,8 +2695,8 @@ function sa_reorder_slides_page() {
2695
  // 2) CREATE THE NEW SLIDES 'OUT' ARRAY (WITH THE NEW SLIDE ORDER)
2696
  $sort_order_arr = explode(",", $sort_order);
2697
  for ($i = 0; $i < count($sort_order_arr); $i++) {
2698
- $loop_prefix = "sa_slide".($i+1); // ascending loop order (1, 2, 3...)
2699
- $order_prefix = "sa_slide".$sort_order_arr[$i]; // slide number to be stored in this slot
2700
  foreach ($data_in_arr as $key => $value) {
2701
  if (strpos($key, $order_prefix) === 0) {
2702
  // metakey key value starts with the order prefix
@@ -2712,6 +2712,64 @@ function sa_reorder_slides_page() {
2712
  }
2713
 
2714
  echo "<h3 id='sar_success_message'>SLIDE ORDER HAS BEEN UPDATED</h3>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2715
  }
2716
 
2717
  // GET REQUIRED SLIDER METADATA AND SAVE WITHIN AN ARRAY
@@ -2752,6 +2810,9 @@ function sa_reorder_slides_page() {
2752
  echo "<div class='sar_image' style='background-image:url(\"".$bg_image."\");'></div>\n";
2753
  echo "<div class='sar_content'>\n";
2754
  echo "<h4 class='sar_slide_num'>SLIDE ".$i."</h4>\n";
 
 
 
2755
  echo "<div class='sar_slide_html'>".nl2br(htmlentities($slide_arr[$i]['content']))."</div>\n";
2756
  echo "</div>";
2757
  echo "</li>\n";
@@ -2762,7 +2823,9 @@ function sa_reorder_slides_page() {
2762
  echo "<form method='post' id='sar_order_form'>\n";
2763
  echo "<input type='hidden' name='sar_slider_id' value='".$slider_id."'/>";
2764
  echo "<input type='hidden' id='sar_sort_order' name='sar_sort_order'/>";
2765
- echo "<input type='submit' value='UPDATE SLIDER'/>";
 
 
2766
  echo "</form>\n";
2767
 
2768
  } else {
@@ -2806,7 +2869,7 @@ function sa_reorder_slides_page() {
2806
  echo "<option value='".$slider_arr[$i]['id']."'>".$slider_arr[$i]['title']." (#".$slider_arr[$i]['id'].")</option>\n";
2807
  }
2808
  echo "<select></div>\n";
2809
- echo "<div><input type='submit' value='Re-Order Slider'/></div>\n";
2810
  echo "</form>\n";
2811
  } else {
2812
  // NO SA SLIDERS FOUND - DISPLAY MESSAGE
2673
  $slider_title = get_the_title($slider_id);
2674
 
2675
  if (isset($_POST['sar_sort_order']) && ($_POST['sar_sort_order'] != '')) {
2676
+ // ### CHANGE THE ORDER OF SLIDE DATA FOR THE SLIDER AND RE-SAVE METADATA ###
2677
  $sort_order = $_POST['sar_sort_order'];
2678
  $data_in_arr = array();
2679
  $data_out_arr = array();
2684
  foreach ($metadata as $key => $value_arr) {
2685
  $value = $value_arr[0];
2686
  for ($i = 1; $i <= $num_slides; $i++) {
2687
+ $key_prefix = "sa_slide".$i."_";
2688
  if (strpos($key, $key_prefix) === 0) {
2689
  // metadata key starts with the key prefix ('sa_slide??')
2690
  $data_in_arr[$key] = $value;
2695
  // 2) CREATE THE NEW SLIDES 'OUT' ARRAY (WITH THE NEW SLIDE ORDER)
2696
  $sort_order_arr = explode(",", $sort_order);
2697
  for ($i = 0; $i < count($sort_order_arr); $i++) {
2698
+ $loop_prefix = "sa_slide".($i+1)."_"; // ascending loop order (1, 2, 3...)
2699
+ $order_prefix = "sa_slide".$sort_order_arr[$i]."_"; // slide number to be stored in this slot
2700
  foreach ($data_in_arr as $key => $value) {
2701
  if (strpos($key, $order_prefix) === 0) {
2702
  // metakey key value starts with the order prefix
2712
  }
2713
 
2714
  echo "<h3 id='sar_success_message'>SLIDE ORDER HAS BEEN UPDATED</h3>";
2715
+ } else {
2716
+ if (isset($_POST['sar_del_slides']) && ($_POST['sar_del_slides'] != '')) {
2717
+ // ### DELETE ALL SLIDES WITH THE 'DELETE SLIDE' CHECKBOX CHECKED ###
2718
+ $del_slides = $_POST['sar_del_slides'];
2719
+ $del_slides_arr = explode(",", $del_slides);
2720
+ $data_in_arr = array();
2721
+ $data_out_arr = array();
2722
+
2723
+ // 1) SAVE SLIDES METADATA TO AN 'IN' ARRAY (ONLY SLIDES MEATDATA AND NO SETTINGS DATA SAVED!)
2724
+ $metadata = get_metadata('post', $slider_id);
2725
+ $num_slides = $metadata['sa_num_slides'][0];
2726
+ foreach ($metadata as $key => $value_arr) {
2727
+ $value = $value_arr[0];
2728
+ for ($i = 1; $i <= $num_slides; $i++) {
2729
+ $key_prefix = "sa_slide".$i."_";
2730
+ if (strpos($key, $key_prefix) === 0) {
2731
+ // metadata key starts with the key prefix ('sa_slide??')
2732
+ $data_in_arr[$i][$key] = $value;
2733
+ }
2734
+ }
2735
+ }
2736
+
2737
+ // 2) CREATE THE NEW SLIDES 'OUT' ARRAY (WITH THE DELETED SLIDES REMOVED)
2738
+ $curr_index = 0;
2739
+ $tot_del = 0;
2740
+ for ($i = 1; $i <= $num_slides; $i++) {
2741
+ $loop_prefix = "sa_slide".$i."_";
2742
+ $delete_yn = 0;
2743
+ for ($j = 0; $j < count($del_slides_arr); $j++) {
2744
+ if ($i == $del_slides_arr[$j]) {
2745
+ $delete_yn = 1;
2746
+ }
2747
+ }
2748
+ if ($delete_yn == 0) {
2749
+ // current slide is NOT to be deleted - copy to 'out' array
2750
+ $curr_index++;
2751
+ $curr_prefix = "sa_slide".$curr_index."_";
2752
+ foreach ($data_in_arr[$i] as $key => $value) {
2753
+ $new_key = str_replace($loop_prefix, $curr_prefix, $key);
2754
+ $data_out_arr[$new_key] = $value;
2755
+ }
2756
+ } else {
2757
+ $tot_del++;
2758
+ }
2759
+ }
2760
+
2761
+ // 3) LOOP THROUGH SLIDES 'OUT' ARRAY UPDATING POST METADATA
2762
+ update_post_meta($slider_id, 'sa_num_slides', $curr_index);
2763
+ foreach ($data_out_arr as $key => $value) {
2764
+ update_post_meta($slider_id, $key, $value);
2765
+ }
2766
+
2767
+ if ($tot_del == 1) {
2768
+ echo "<h3 id='sar_success_message'>".$tot_del." SLIDE HAS BEEN DELETED</h3>";
2769
+ } else {
2770
+ echo "<h3 id='sar_success_message'>".$tot_del." SLIDES HAVE BEEN DELETED</h3>";
2771
+ }
2772
+ }
2773
  }
2774
 
2775
  // GET REQUIRED SLIDER METADATA AND SAVE WITHIN AN ARRAY
2810
  echo "<div class='sar_image' style='background-image:url(\"".$bg_image."\");'></div>\n";
2811
  echo "<div class='sar_content'>\n";
2812
  echo "<h4 class='sar_slide_num'>SLIDE ".$i."</h4>\n";
2813
+ echo "<div class='sar_del_slide'>DELETE <span>SLIDE</span>";
2814
+ echo "<input type='checkbox' id='sar_del".$i."' name='sar_del".$i."' class='sar_del_checkbox'/>";
2815
+ echo "</div>\n";
2816
  echo "<div class='sar_slide_html'>".nl2br(htmlentities($slide_arr[$i]['content']))."</div>\n";
2817
  echo "</div>";
2818
  echo "</li>\n";
2823
  echo "<form method='post' id='sar_order_form'>\n";
2824
  echo "<input type='hidden' name='sar_slider_id' value='".$slider_id."'/>";
2825
  echo "<input type='hidden' id='sar_sort_order' name='sar_sort_order'/>";
2826
+ echo "<input type='hidden' id='sar_del_slides' name='sar_del_slides'/>";
2827
+ echo "<input type='submit' id='sar_update_but' value='UPDATE ORDER'/>";
2828
+ echo "<input type='submit' id='sar_delete_but' value='DELETE SLIDES'/>";
2829
  echo "</form>\n";
2830
 
2831
  } else {
2869
  echo "<option value='".$slider_arr[$i]['id']."'>".$slider_arr[$i]['title']." (#".$slider_arr[$i]['id'].")</option>\n";
2870
  }
2871
  echo "<select></div>\n";
2872
+ echo "<div><input type='submit' value='Select Slider'/></div>\n";
2873
  echo "</form>\n";
2874
  } else {
2875
  // NO SA SLIDERS FOUND - DISPLAY MESSAGE
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: 5.2
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -314,6 +314,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
314
  = 2.3.6 =
315
  * Added the 'Show 1 Dot Per Slide' checkbox option which when checked displays 1 pagination dot per slide (instead of 1 pagination dot per page of slides)
316
 
 
 
 
317
  == Upgrade Notice ==
318
 
319
  = 1.0 =
@@ -529,4 +532,7 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
529
  * Added the 'Re-Order Slides' sub-page, which allows one to easily change the order of slides within a Slide Anything slider with a 'drag-and-drop' interface
530
 
531
  = 2.3.6 =
532
- * Added the 'Show 1 Dot Per Slide' checkbox option which when checked displays 1 pagination dot per slide (instead of 1 pagination dot per page of slides)
 
 
 
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.2.2
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
314
  = 2.3.6 =
315
  * Added the 'Show 1 Dot Per Slide' checkbox option which when checked displays 1 pagination dot per slide (instead of 1 pagination dot per page of slides)
316
 
317
+ = 2.3.7 =
318
+ * Added the option to bulk delete slides within the 'Re-Order Slides' page
319
+
320
  == Upgrade Notice ==
321
 
322
  = 1.0 =
532
  * Added the 'Re-Order Slides' sub-page, which allows one to easily change the order of slides within a Slide Anything slider with a 'drag-and-drop' interface
533
 
534
  = 2.3.6 =
535
+ * Added the 'Show 1 Dot Per Slide' checkbox option which when checked displays 1 pagination dot per slide (instead of 1 pagination dot per page of slides)
536
+
537
+ = 2.3.7 =
538
+ * Added the option to bulk delete slides within the 'Re-Order Slides' page
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.3.6
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.3.7
8
  * License: GPLv2 or later
9
  */
10