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

Version Description

  • YouTube popups now set the slide background to the YouTube thumbnail by default

=

Download this release

Release Info

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

Code changes from version 2.3.13 to 2.3.14

js/slide-anything-admin.js CHANGED
@@ -1093,6 +1093,26 @@ function update_popup_video(slide_no) {
1093
  }
1094
  }
1095
  if (video_type == 'youtube') {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
  // clear video url input field
1097
  document.getElementById("sa_slide" + slide_no + "_video_url").value = '';
1098
  // update hidden video id and video type fields
1093
  }
1094
  }
1095
  if (video_type == 'youtube') {
1096
+ // ##### SET SLIDE BACKGROUND IMAGE TO YOUTUBE THUMB IMAGE - 14 MAY 2020 - START #####
1097
+ // Get the YouTube video thumbnail image
1098
+ var youtube_thumb = "https://img.youtube.com/vi/" + valid_video_id + "/hqdefault.jpg";
1099
+ // Set the "Use Popup Image as Slide Background" dropdown to "No"
1100
+ var popup_bg_dropdown = "#sa_slide" + slide_no + "_popup_background";
1101
+ jQuery(popup_bg_dropdown).val('no');
1102
+ // Set the slide background "Set Image" button to be visible
1103
+ var set_image_button = "#slide" + slide_no + "_image_add";
1104
+ jQuery(set_image_button).css("display", "inline-block");
1105
+ // Set slide background IMAGE ID to 99999999 (this value indicates the YouTube thumb must be used)
1106
+ var slide_image_id = "#sa_slide" + slide_no + "_image_id";
1107
+ jQuery(slide_image_id).val(99999999);
1108
+ // Set the slide background "Preview Image" DIV background image to the YouTube Thumbnail
1109
+ var slide_imagebg_popup = "#slide" + slide_no + "_imagebg_popup";
1110
+ var slide_thumb = "#slide" + slide_no + "_thumb";
1111
+ jQuery(slide_thumb + " > div").css("background-image", "url('" + youtube_thumb + "')");
1112
+ jQuery(slide_imagebg_popup).css("display", "none");
1113
+ jQuery(slide_thumb).css("display", "block");
1114
+ // ##### SET SLIDE BACKGROUND IMAGE TO YOUTUBE THUMB IMAGE - 14 MAY 2020 - END #####
1115
+
1116
  // clear video url input field
1117
  document.getElementById("sa_slide" + slide_no + "_video_url").value = '';
1118
  // update hidden video id and video type fields
php/slide-anything-admin.php CHANGED
@@ -939,16 +939,28 @@ function cpt_slider_slides_content($post) {
939
  echo "<span id='".esc_attr($slide_data[$i]['image_del'])."' onClick='remove_slide_bg_image(\"".esc_attr($slide_data[$i]['slide_no'])."\");' title='Delete the background image for this slide'>X</span>\n";
940
  echo "</div>\n";
941
  } else {
942
- echo "<div style='background-color:#ffffff; background-size:".esc_attr($slide_image_size)."; ";
943
- echo "background-repeat:".esc_attr($slide_image_repeat)."; background-color:".esc_attr($slide_image_color)."; ";
944
- echo "background-position:".esc_attr($slide_image_pos).";'></div>\n";
945
- echo "<span id='".esc_attr($slide_data[$i]['image_del'])."' class='sa_hidden' onClick='remove_slide_bg_image(\"".esc_attr($slide_data[$i]['slide_no'])."\");' title='Delete the background image for this slide'>X</span>\n";
946
- echo "</div>\n";
 
 
 
 
 
 
 
 
 
 
 
 
947
  }
948
  // slide background image - 'set image' button
949
  echo "<a class='button button-secondary slide_image_add' id='slide".esc_attr($slide_data[$i]['slide_no'])."_image_add' ";
950
  echo "href='".esc_attr($upload_frame_url)."' title='Set the background image for this slide'>Set Image</a>\n";
951
- // slide background image - image id text field
952
  echo "<input type='hidden' id='".esc_attr($slide_data[$i]['image_id'])."' name='".esc_attr($slide_data[$i]['image_id'])."' value='".esc_attr($slide_image_id)."'/>\n";
953
 
954
  // SLIDE BACKGROUND IMAGE - BACKGROUND POSITION (dropdown box)
939
  echo "<span id='".esc_attr($slide_data[$i]['image_del'])."' onClick='remove_slide_bg_image(\"".esc_attr($slide_data[$i]['slide_no'])."\");' title='Delete the background image for this slide'>X</span>\n";
940
  echo "</div>\n";
941
  } else {
942
+ $slide_popup_type = get_post_meta($post->ID, $slide_data[$i]['popup_type'], true);
943
+ $popup_video_type = get_post_meta($post->ID, $slide_data[$i]['popup_video_type'], true);
944
+ $popup_video_id = get_post_meta($post->ID, $slide_data[$i]['popup_video_id'], true);
945
+ if (($slide_image_id == "99999999") && ($slide_popup_type == "VIDEO") && ($popup_video_type == "youtube")) {
946
+ $youtube_thumb = "https://img.youtube.com/vi/".$popup_video_id."/hqdefault.jpg";
947
+ echo "<div style='background-image:url(\"".$youtube_thumb."\"); background-size:".esc_attr($slide_image_size)."; ";
948
+ echo "background-repeat:".esc_attr($slide_image_repeat)."; background-color:".esc_attr($slide_image_color)."; ";
949
+ echo "background-position:".esc_attr($slide_image_pos).";'></div>\n";
950
+ echo "<span id='".esc_attr($slide_data[$i]['image_del'])."' onClick='remove_slide_bg_image(\"".esc_attr($slide_data[$i]['slide_no'])."\");' title='Delete the background image for this slide'>X</span>\n";
951
+ echo "</div>\n";
952
+ } else {
953
+ echo "<div style='background-color:#ffffff; background-size:".esc_attr($slide_image_size)."; ";
954
+ echo "background-repeat:".esc_attr($slide_image_repeat)."; background-color:".esc_attr($slide_image_color)."; ";
955
+ echo "background-position:".esc_attr($slide_image_pos).";'></div>\n";
956
+ echo "<span id='".esc_attr($slide_data[$i]['image_del'])."' class='sa_hidden' onClick='remove_slide_bg_image(\"".esc_attr($slide_data[$i]['slide_no'])."\");' title='Delete the background image for this slide'>X</span>\n";
957
+ echo "</div>\n";
958
+ }
959
  }
960
  // slide background image - 'set image' button
961
  echo "<a class='button button-secondary slide_image_add' id='slide".esc_attr($slide_data[$i]['slide_no'])."_image_add' ";
962
  echo "href='".esc_attr($upload_frame_url)."' title='Set the background image for this slide'>Set Image</a>\n";
963
+ // slide background image - image id hidden field
964
  echo "<input type='hidden' id='".esc_attr($slide_data[$i]['image_id'])."' name='".esc_attr($slide_data[$i]['image_id'])."' value='".esc_attr($slide_image_id)."'/>\n";
965
 
966
  // SLIDE BACKGROUND IMAGE - BACKGROUND POSITION (dropdown box)
php/slide-anything-frontend.php CHANGED
@@ -546,6 +546,14 @@ function slide_anything_shortcode($atts) {
546
  if (($slide_data["slide".$i."_popup_background"] != 'no') && ($slide_data["slide".$i."_popup_image"] != '')) {
547
  $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_popup_imageid"], $slide_data["slide".$i."_popup_background"]);
548
  }
 
 
 
 
 
 
 
 
549
  }
550
  $slide_image_size = $slide_data["slide".$i."_image_size"];
551
  $slide_image_pos = $slide_data["slide".$i."_image_pos"];
546
  if (($slide_data["slide".$i."_popup_background"] != 'no') && ($slide_data["slide".$i."_popup_image"] != '')) {
547
  $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_popup_imageid"], $slide_data["slide".$i."_popup_background"]);
548
  }
549
+ } elseif (($sa_pro_version) && ($slide_data["slide".$i."_popup_type"] == 'VIDEO')) {
550
+ if ($slide_data["slide".$i."_popup_video_type"] == "youtube") {
551
+ if ($slide_data["slide".$i."_image_id"] == '99999999') {
552
+ $slide_image_src = array();
553
+ $popup_video_id = $slide_data["slide".$i."_popup_video_id"];
554
+ $slide_image_src[0] = "https://img.youtube.com/vi/".$popup_video_id."/hqdefault.jpg";
555
+ }
556
+ }
557
  }
558
  $slide_image_size = $slide_data["slide".$i."_image_size"];
559
  $slide_image_pos = $slide_data["slide".$i."_image_pos"];
readme.txt CHANGED
@@ -335,6 +335,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
335
  = 2.3.13 =
336
  * Minor bug fix: PHP 'Undefined Index' warnings were sometimes displayed after upgrading to Slide Anything PRO (and the slider was created using the Slide Anything FREE plugin)
337
 
 
 
 
338
  == Upgrade Notice ==
339
 
340
  = 1.0 =
@@ -571,4 +574,7 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
571
  * Added a new feature (checkbox) to vertically center content within slides.
572
 
573
  = 2.3.13 =
574
- * Minor bug fix: PHP 'Undefined Index' warnings were sometimes displayed after upgrading to Slide Anything PRO (and the slider was created using the Slide Anything FREE plugin)
 
 
 
335
  = 2.3.13 =
336
  * Minor bug fix: PHP 'Undefined Index' warnings were sometimes displayed after upgrading to Slide Anything PRO (and the slider was created using the Slide Anything FREE plugin)
337
 
338
+ = 2.3.14 =
339
+ * YouTube popups now set the slide background to the YouTube thumbnail by default
340
+
341
  == Upgrade Notice ==
342
 
343
  = 1.0 =
574
  * Added a new feature (checkbox) to vertically center content within slides.
575
 
576
  = 2.3.13 =
577
+ * Minor bug fix: PHP 'Undefined Index' warnings were sometimes displayed after upgrading to Slide Anything PRO (and the slider was created using the Slide Anything FREE plugin)
578
+
579
+ = 2.3.14 =
580
+ * YouTube popups now set the slide background to the YouTube thumbnail by default
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.13
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.14
8
  * License: GPLv2 or later
9
  */
10