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

Version Description

  • Fixed a bug that occurred when migrating a WP site to another domain location (e.g. transferring a staging/test WP site to a Live WP site). The SA slider would not work on the new domain unless it was re-saved in the back-end. This has now been fixed with this release.

=

Download this release

Release Info

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

Code changes from version 2.1.9 to 2.1.11

php/slide-anything-admin.php CHANGED
@@ -1666,8 +1666,8 @@ function cpt_slider_style_content($post) {
1666
  if ($window_onload == '') {
1667
  $window_onload = '0';
1668
  }
1669
- $tooltip = 'Use this option if your slider is not being sized correctly within your page container ';
1670
- $tooltip .= '(sometimes occurs with Visual Composer full-width sections)';
1671
  echo "<div id='sa_window_onload_line'>";
1672
  echo "<span class='sa_tooltip' title='".$tooltip."'></span>Use 'window.onload' event:";
1673
  if ($window_onload == '1') {
1666
  if ($window_onload == '') {
1667
  $window_onload = '0';
1668
  }
1669
+ $tooltip = 'Use window.onload event (not document.ready). Use this option if your slider is ';
1670
+ $tooltip .= 'not being sized correctly within your page container (sometimes occurs with Visual Composer full-width sections).';
1671
  echo "<div id='sa_window_onload_line'>";
1672
  echo "<span class='sa_tooltip' title='".$tooltip."'></span>Use 'window.onload' event:";
1673
  if ($window_onload == '1') {
php/slide-anything-frontend.php CHANGED
@@ -55,13 +55,6 @@ function slide_anything_shortcode($atts) {
55
  $slide_data['css_id'] = $metadata['sa_css_id'][0];
56
  for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
57
  $slide_data["slide".$i."_num"] = $i;
58
- // get the valid content character count and the actual content character count
59
- $slide_data["slide".$i."_valid_char_count"] = $metadata["sa_slide".$i."_char_count"][0];
60
- if ($slide_data["slide".$i."_valid_char_count"] == 0) {
61
- $slide_data["slide".$i."_actual_char_count"] = 0; // valid character count does not exist so set actual count to matching zero
62
- } else {
63
- $slide_data["slide".$i."_actual_char_count"] = strlen($metadata["sa_slide".$i."_content"][0]);
64
- }
65
  // apply 'the_content' filter to slide content to process any shortcodes
66
  if ($slide_data['shortcodes'] == 'true') {
67
  $slide_data["slide".$i."_content"] = do_shortcode($metadata["sa_slide".$i."_content"][0]);
@@ -218,9 +211,12 @@ function slide_anything_shortcode($atts) {
218
  if ($slide_data['slide_icons_color'] != 'black') {
219
  $slide_data['slide_icons_color'] = 'white';
220
  }
221
- $slide_data['sa_window_onload'] = $metadata['sa_window_onload'][0];
222
- if ($slide_data['sa_window_onload'] != '1') {
223
- $slide_data['sa_window_onload'] = '0';
 
 
 
224
  }
225
 
226
  // REVERSE THE ORDER OF THE SLIDES IF 'Random Order' CHECKBOX IS CHECKED OR
@@ -316,107 +312,101 @@ function slide_anything_shortcode($atts) {
316
  $lightbox_count = 0;
317
  }
318
  for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
319
- $valid_char_count = $slide_data["slide".$i."_valid_char_count"];
320
- $actual_char_count = $slide_data["slide".$i."_actual_char_count"];
321
- // validate that slide content contains the correct number of characters, otherwise do not display slide
322
- // {to prevent malicious content being inserted into slides)
323
- if ($valid_char_count == $actual_char_count) {
324
- $slide_content = $slide_data["slide".$i."_content"];
325
- $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_image_id"], 'full');
326
- // SA PRO VERSION - USE POPUP IMAGE AS SLIDE BACKGROUND IMAGE (IF THIS OPTION SELECTED)
327
- if (($sa_pro_version) && ($slide_data["slide".$i."_popup_type"] == 'IMAGE')) {
328
- if (($slide_data["slide".$i."_popup_background"] != 'no') && ($slide_data["slide".$i."_popup_image"] != '')) {
329
- $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_popup_imageid"], $slide_data["slide".$i."_popup_background"]);
330
- }
331
- }
332
- $slide_image_size = $slide_data["slide".$i."_image_size"];
333
- $slide_image_pos = $slide_data["slide".$i."_image_pos"];
334
- $slide_image_repeat = $slide_data["slide".$i."_image_repeat"];
335
- $slide_image_color = $slide_data["slide".$i."_image_color"];
336
- $slide_style = "padding:".$slide_data['slide_padding_tb']."% ".$slide_data['slide_padding_lr']."%; ";
337
- $slide_style .= "margin:0px ".$slide_data['slide_margin_lr']."%; ";
338
- $slide_style .= "background-image:url(\"".$slide_image_src[0]."\"); ";
339
- $slide_style .= "background-position:".$slide_image_pos."; ";
340
- $slide_style .= "background-size:".$slide_image_size."; ";
341
- $slide_style .= "background-repeat:".$slide_image_repeat."; ";
342
- $slide_style .= "background-color:".$slide_image_color."; ";
343
- if (strpos($slide_data['slide_min_height_perc'], 'px') !== false) {
344
- $slide_style .= "min-height:".$slide_data['slide_min_height_perc']."; ";
345
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
346
 
347
- // BUILD SLIDE LINK HOVER BUTTON
348
- $link_output = '';
349
- if ($slide_data["slide".$i."_link_url"] != '') {
350
- $link_output = "<a class='sa_slide_link_icon' href='".$slide_data["slide".$i."_link_url"]."' ";
351
- $link_output .= "target='".$slide_data["slide".$i."_link_target"]."'></a>";
352
- }
353
 
354
- // BUILD POPUP HOVER BUTTON - PRO VERSION ONLY!
355
- $popup_output = '';
356
- if ($sa_pro_version) {
357
- if (($slide_data["slide".$i."_popup_type"] == 'IMAGE') && ($slide_data["slide".$i."_popup_image"] != '')) {
358
- $lightbox_count++;
359
- $popup_output = "<div class='sa_popup_zoom_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
360
- }
361
- if (($slide_data["slide".$i."_popup_type"] == 'VIDEO') && ($slide_data["slide".$i."_popup_video_id"] != '')) {
362
- $lightbox_count++;
363
- $popup_output = "<div class='sa_popup_video_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
364
- }
365
- if ($slide_data["slide".$i."_popup_type"] == 'HTML') {
366
- $lightbox_count++;
367
- $popup_output = "<div class='sa_popup_zoom_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
368
- }
369
  }
 
370
 
371
- // DISPLAY SLIDE OUTPUT
372
- //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
373
- //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
374
- $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
375
- $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
376
- if (($link_output != '') || ($popup_output != '')) {
377
- if ($slide_data['slide_icons_location'] == 'Top Left') {
378
- // icons location - top left
379
- $style = "top:0px; left:0px; margin:0px;";
380
- } elseif ($slide_data['slide_icons_location'] == 'Top Center') {
381
- // icons location - top center
382
- if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
383
- else { $hov_marginL = '-20px'; }
384
- $style = "top:0px; left:50%; margin-left:".$hov_marginL.";";
385
- } elseif ($slide_data['slide_icons_location'] == 'Top Right') {
386
- // icons location - top right
387
- $style = "top:0px; right:0px; margin:0px;";
388
- } elseif ($slide_data['slide_icons_location'] == 'Bottom Left') {
389
- // icons location - bottom left
390
- $style = "bottom:0px; left:0px; margin:0px;";
391
- } elseif ($slide_data['slide_icons_location'] == 'Bottom Center') {
392
- // icons location - bottom center
393
- if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
394
- else { $hov_marginL = '-20px'; }
395
- $style = "bottom:0px; left:50%; margin-left:".$hov_marginL.";";
396
- } elseif ($slide_data['slide_icons_location'] == 'Bottom Right') {
397
- // icons location - bottom right
398
- $style = "bottom:0px; right:0px; margin:0px;";
399
- } else {
400
- // icons location - center center (default)
401
- if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
402
- else { $hov_marginL = '-20px'; }
403
- $style = "top:50%; left:50%; margin-top:-20px; margin-left:".$hov_marginL.";";
404
- }
405
- if ($slide_data['slide_icons_visible'] == 'true') {
406
- $output .= "<div class='sa_hover_buttons always_visible' style='".$style."'>";
407
- } else {
408
- $output .= "<div class='sa_hover_buttons' style='".$style."'>";
409
- }
410
- if ($link_output != '') {
411
- $output .= $link_output;
412
- }
413
- if ($popup_output != '') {
414
- $output .= $popup_output;
415
- }
416
- $output .= "</div>\n"; // .sa_hover_buttons
417
  }
418
- $output .= $slide_content."</div>\n"; // .sa_hover_container
419
  }
 
420
  }
421
  $output .= "</div>\n";
422
  $output .= "</div>\n";
55
  $slide_data['css_id'] = $metadata['sa_css_id'][0];
56
  for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
57
  $slide_data["slide".$i."_num"] = $i;
 
 
 
 
 
 
 
58
  // apply 'the_content' filter to slide content to process any shortcodes
59
  if ($slide_data['shortcodes'] == 'true') {
60
  $slide_data["slide".$i."_content"] = do_shortcode($metadata["sa_slide".$i."_content"][0]);
211
  if ($slide_data['slide_icons_color'] != 'black') {
212
  $slide_data['slide_icons_color'] = 'white';
213
  }
214
+ $slide_data['sa_window_onload'] = '0';
215
+ if (isset($metadata['sa_window_onload'])) {
216
+ $slide_data['sa_window_onload'] = $metadata['sa_window_onload'][0];
217
+ if ($slide_data['sa_window_onload'] != '1') {
218
+ $slide_data['sa_window_onload'] = '0';
219
+ }
220
  }
221
 
222
  // REVERSE THE ORDER OF THE SLIDES IF 'Random Order' CHECKBOX IS CHECKED OR
312
  $lightbox_count = 0;
313
  }
314
  for ($i = 1; $i <= $slide_data['num_slides']; $i++) {
315
+ $slide_content = $slide_data["slide".$i."_content"];
316
+ $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_image_id"], 'full');
317
+ // SA PRO VERSION - USE POPUP IMAGE AS SLIDE BACKGROUND IMAGE (IF THIS OPTION SELECTED)
318
+ if (($sa_pro_version) && ($slide_data["slide".$i."_popup_type"] == 'IMAGE')) {
319
+ if (($slide_data["slide".$i."_popup_background"] != 'no') && ($slide_data["slide".$i."_popup_image"] != '')) {
320
+ $slide_image_src = wp_get_attachment_image_src($slide_data["slide".$i."_popup_imageid"], $slide_data["slide".$i."_popup_background"]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
+ }
323
+ $slide_image_size = $slide_data["slide".$i."_image_size"];
324
+ $slide_image_pos = $slide_data["slide".$i."_image_pos"];
325
+ $slide_image_repeat = $slide_data["slide".$i."_image_repeat"];
326
+ $slide_image_color = $slide_data["slide".$i."_image_color"];
327
+ $slide_style = "padding:".$slide_data['slide_padding_tb']."% ".$slide_data['slide_padding_lr']."%; ";
328
+ $slide_style .= "margin:0px ".$slide_data['slide_margin_lr']."%; ";
329
+ $slide_style .= "background-image:url(\"".$slide_image_src[0]."\"); ";
330
+ $slide_style .= "background-position:".$slide_image_pos."; ";
331
+ $slide_style .= "background-size:".$slide_image_size."; ";
332
+ $slide_style .= "background-repeat:".$slide_image_repeat."; ";
333
+ $slide_style .= "background-color:".$slide_image_color."; ";
334
+ if (strpos($slide_data['slide_min_height_perc'], 'px') !== false) {
335
+ $slide_style .= "min-height:".$slide_data['slide_min_height_perc']."; ";
336
+ }
337
 
338
+ // BUILD SLIDE LINK HOVER BUTTON
339
+ $link_output = '';
340
+ if ($slide_data["slide".$i."_link_url"] != '') {
341
+ $link_output = "<a class='sa_slide_link_icon' href='".$slide_data["slide".$i."_link_url"]."' ";
342
+ $link_output .= "target='".$slide_data["slide".$i."_link_target"]."'></a>";
343
+ }
344
 
345
+ // BUILD POPUP HOVER BUTTON - PRO VERSION ONLY!
346
+ $popup_output = '';
347
+ if ($sa_pro_version) {
348
+ if (($slide_data["slide".$i."_popup_type"] == 'IMAGE') && ($slide_data["slide".$i."_popup_image"] != '')) {
349
+ $lightbox_count++;
350
+ $popup_output = "<div class='sa_popup_zoom_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
351
+ }
352
+ if (($slide_data["slide".$i."_popup_type"] == 'VIDEO') && ($slide_data["slide".$i."_popup_video_id"] != '')) {
353
+ $lightbox_count++;
354
+ $popup_output = "<div class='sa_popup_video_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
355
+ }
356
+ if ($slide_data["slide".$i."_popup_type"] == 'HTML') {
357
+ $lightbox_count++;
358
+ $popup_output = "<div class='sa_popup_zoom_icon' onClick='".$lightbox_function."(".$lightbox_count.");'></div>";
 
359
  }
360
+ }
361
 
362
+ // DISPLAY SLIDE OUTPUT
363
+ //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
364
+ //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
365
+ $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
366
+ $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
367
+ if (($link_output != '') || ($popup_output != '')) {
368
+ if ($slide_data['slide_icons_location'] == 'Top Left') {
369
+ // icons location - top left
370
+ $style = "top:0px; left:0px; margin:0px;";
371
+ } elseif ($slide_data['slide_icons_location'] == 'Top Center') {
372
+ // icons location - top center
373
+ if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
374
+ else { $hov_marginL = '-20px'; }
375
+ $style = "top:0px; left:50%; margin-left:".$hov_marginL.";";
376
+ } elseif ($slide_data['slide_icons_location'] == 'Top Right') {
377
+ // icons location - top right
378
+ $style = "top:0px; right:0px; margin:0px;";
379
+ } elseif ($slide_data['slide_icons_location'] == 'Bottom Left') {
380
+ // icons location - bottom left
381
+ $style = "bottom:0px; left:0px; margin:0px;";
382
+ } elseif ($slide_data['slide_icons_location'] == 'Bottom Center') {
383
+ // icons location - bottom center
384
+ if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
385
+ else { $hov_marginL = '-20px'; }
386
+ $style = "bottom:0px; left:50%; margin-left:".$hov_marginL.";";
387
+ } elseif ($slide_data['slide_icons_location'] == 'Bottom Right') {
388
+ // icons location - bottom right
389
+ $style = "bottom:0px; right:0px; margin:0px;";
390
+ } else {
391
+ // icons location - center center (default)
392
+ if (($link_output != '') && ($popup_output != '')) { $hov_marginL = '-40px'; }
393
+ else { $hov_marginL = '-20px'; }
394
+ $style = "top:50%; left:50%; margin-top:-20px; margin-left:".$hov_marginL.";";
395
+ }
396
+ if ($slide_data['slide_icons_visible'] == 'true') {
397
+ $output .= "<div class='sa_hover_buttons always_visible' style='".$style."'>";
398
+ } else {
399
+ $output .= "<div class='sa_hover_buttons' style='".$style."'>";
400
+ }
401
+ if ($link_output != '') {
402
+ $output .= $link_output;
403
+ }
404
+ if ($popup_output != '') {
405
+ $output .= $popup_output;
 
 
406
  }
407
+ $output .= "</div>\n"; // .sa_hover_buttons
408
  }
409
+ $output .= $slide_content."</div>\n"; // .sa_hover_container
410
  }
411
  $output .= "</div>\n";
412
  $output .= "</div>\n";
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.7
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -214,6 +214,12 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
214
  = 2.1.9 =
215
  * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
216
 
 
 
 
 
 
 
217
  == Upgrade Notice ==
218
 
219
  = 1.0 =
@@ -342,4 +348,10 @@ The `SLIDE STYLE` settings are the style settings for each individual slide with
342
  * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
343
 
344
  = 2.1.9 =
345
- * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
 
 
 
 
 
 
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
214
  = 2.1.9 =
215
  * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
216
 
217
+ = 2.1.10 =
218
+ * Minor bug fix for the new 'Use window.onload event' checkbox setting.
219
+
220
+ = 2.1.11 =
221
+ * Fixed a bug that occurred when migrating a WP site to another domain location (e.g. transferring a staging/test WP site to a Live WP site). The SA slider would not work on the new domain unless it was re-saved in the back-end. This has now been fixed with this release.
222
+
223
  == Upgrade Notice ==
224
 
225
  = 1.0 =
348
  * For Slide Anything PRO YouTube video popups, added the 'rel=0' paramerter so that related videos are not displayed at the end of a video playback. This has been requested quite a bit, and I have modified the 'Magnific Popup' code so that this parameter is added to the iframe code generated.
349
 
350
  = 2.1.9 =
351
+ * Added a new 'Use window.onload event' checkbox setting. By default, Slide Anything loads it JavaSctipt/jQuery code during the 'document.ready' event. If this new option is checked, then the JavaSctipt/jQuery code is loaded during the 'window.onload' event, and this event is only executed after all the assets for the page have been loaded - all images, CSS etc. Using this option solves an issue that sometimes occurs when inserting a Slide Anything slider into a Visual Composer full-width section, and these full-width containers are created/calculated dynamically by adding negative left/right margins to the container after the SA JavaScript/jQuery code is executed.
352
+
353
+ = 2.1.10 =
354
+ * Minor bug fix for the new 'Use window.onload event' checkbox setting.
355
+
356
+ = 2.1.11 =
357
+ * Fixed a bug that occurred when migrating a WP site to another domain location (e.g. transferring a staging/test WP site to a Live WP site). The SA slider would not work on the new domain unless it was re-saved in the back-end. This has now been fixed with this release.
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.9
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.11
8
  * License: GPLv2 or later
9
  */
10