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

Version Description

  • Added a new option 'Don't use CSS IDs for slides' - when checked CSS Classes will be used instead of CSS IDs to identify each slide container.
Download this release

Release Info

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

Code changes from version 2.3.41 to 2.3.42

css/slide-anything-admin.css CHANGED
@@ -1253,22 +1253,22 @@ input.sa_slide_popup_imagetitle:-ms-input-placeholder { color:#c0c0c0 !important
1253
  }
1254
 
1255
  /* other settings */
1256
- #slider_style_metabox #sa_window_onload_line {
1257
  padding:5px 0px 10px 0px !important;
1258
  font-size:13px !important;
1259
  line-height:18px !important;
1260
  cursor:help !important;
1261
  }
1262
- #slider_style_metabox #sa_window_onload_line span {
1263
  margin-right:5px;
1264
  float:left !important;
1265
  display:block !important;
1266
  }
1267
- #slider_style_metabox #sa_window_onload_line input[type=checkbox] {
1268
  margin-left:10px !important;
1269
  margin-right:0px !important;
1270
  }
1271
- #slider_style_metabox #sa_window_onload_line select {
1272
  box-sizing:border-box !important;
1273
  height:auto !important;
1274
  min-height:0px !important;
1253
  }
1254
 
1255
  /* other settings */
1256
+ #slider_style_metabox .sa_window_onload_line {
1257
  padding:5px 0px 10px 0px !important;
1258
  font-size:13px !important;
1259
  line-height:18px !important;
1260
  cursor:help !important;
1261
  }
1262
+ #slider_style_metabox .sa_window_onload_line span {
1263
  margin-right:5px;
1264
  float:left !important;
1265
  display:block !important;
1266
  }
1267
+ #slider_style_metabox .sa_window_onload_line input[type=checkbox] {
1268
  margin-left:10px !important;
1269
  margin-right:0px !important;
1270
  }
1271
+ #slider_style_metabox .sa_window_onload_line select {
1272
  box-sizing:border-box !important;
1273
  height:auto !important;
1274
  min-height:0px !important;
php/slide-anything-admin.php CHANGED
@@ -912,12 +912,32 @@ function cpt_slider_slides_content($post) {
912
 
913
  // ###### LOOP TO DISPLAY INPUT ELEMENTS FOR EACH SLIDE ######
914
  echo "<div id='slider_accordion'>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
915
  for ($i = 0; $i < count($slide_data); $i++) {
916
  // DISPLAY ACCORDION HEADING
917
  echo "<h3>Slide ".$slide_data[$i]['slide_no'];
918
  $css_id = $slider_css_id."_slide".sprintf('%02d', $slide_data[$i]['slide_no']);
919
- // display CSS ID for the current slide
920
- echo "<span>#".$css_id."</span>";
 
 
 
 
921
  echo "</h3>\n";
922
  echo "<div>\n";
923
 
@@ -2131,17 +2151,23 @@ function cpt_slider_style_content($post) {
2131
  }
2132
  // setting 7 - bg_image_size
2133
  $bg_image_size = 'full';
2134
- if (isset($other_settings_arr) && (count($other_settings_arr)) > 6) {
2135
  if ($other_settings_arr[6] != '') {
2136
  $bg_image_size = $other_settings_arr[6];
2137
  }
2138
  }
 
 
 
 
 
 
2139
 
2140
  // USE 'DOMContentLoaded' EVENT (checkbox)
2141
  $tooltip = 'Load the Slide Anything JavaScript during the DOMContentLoaded event. Use this option if jQuery ';
2142
  $tooltip .= 'is loading in your theme footer and you are getting the JavaScript error message ';
2143
  $tooltip .= '&quot;Uncaught ReferenceError: jQuery is not defined&quot;.';
2144
- echo "<div id='sa_window_onload_line'>";
2145
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>DOMContentLoaded event:</span>";
2146
  if ($window_onload == '1') {
2147
  echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
@@ -2152,7 +2178,7 @@ function cpt_slider_style_content($post) {
2152
 
2153
  // Strip JavaScript from Content
2154
  $tooltip = 'Remove JavaScript (<script> tags) from slide content for extra security.';
2155
- echo "<div id='sa_window_onload_line'>";
2156
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Remove JavaScript Content:</span>";
2157
  if ($strip_javascript == '1') {
2158
  echo "<input type='checkbox' id='sa_strip_javascript' name='sa_strip_javascript' value='1' checked/>";
@@ -2165,7 +2191,7 @@ function cpt_slider_style_content($post) {
2165
  // ##### REMOVE LAZY LOAD IMAGES FEATURE (WHICH IS NOW INCLUDED IN WP 5.5) #####
2166
  /*
2167
  $tooltip = "Enable &quot;Lazy Load&quot; for images added to your slide content (note: does not apply to slide backgrounds).";
2168
- echo "<div id='sa_window_onload_line'>";
2169
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Enable 'Lazy Load' Images:</span>";
2170
  if ($lazy_load_images == '1') {
2171
  echo "<input type='checkbox' id='sa_lazy_load_images' name='sa_lazy_load_images' value='1' checked/>";
@@ -2180,7 +2206,7 @@ function cpt_slider_style_content($post) {
2180
 
2181
  // Use UL and LI Containers
2182
  $tooltip = "Use &quot;UL&quot; as the DOM element for &quot;owl-stage&quot; and use &quot;LI&quot; as the DOM elements for &quot;owl-item&quot;.";
2183
- echo "<div id='sa_window_onload_line'>";
2184
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Use UL and LI Containers:</span>";
2185
  if ($ulli_containers == '1') {
2186
  echo "<input type='checkbox' id='sa_ulli_containers' name='sa_ulli_containers' value='1' checked/>";
@@ -2191,7 +2217,7 @@ function cpt_slider_style_content($post) {
2191
 
2192
  // Right to Left Slider
2193
  $tooltip = "Change the direction of the slider to be right to left.";
2194
- echo "<div id='sa_window_onload_line'>";
2195
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Right to Left Slider:</span>";
2196
  if ($rtl_slider == '1') {
2197
  echo "<input type='checkbox' id='sa_rtl_slider' name='sa_rtl_slider' value='1' checked/>";
@@ -2202,7 +2228,7 @@ function cpt_slider_style_content($post) {
2202
 
2203
  // Disable Preview Feature
2204
  $tooltip = "Disable the &quot;Preview Slider&quot; feature in this settings page - the &quot;Slide Anything Popup Preview&quot; page will no longer be auto generated.";
2205
- echo "<div id='sa_window_onload_line'>";
2206
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Disable Preview Feature:</span>";
2207
  if ($disable_preview == '1') {
2208
  echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1' checked/>";
@@ -2211,6 +2237,17 @@ function cpt_slider_style_content($post) {
2211
  }
2212
  echo "</div>\n";
2213
 
 
 
 
 
 
 
 
 
 
 
 
2214
  // Start Position
2215
  $num_slides = intval(get_post_meta($post->ID, 'sa_num_slides', true));
2216
  if ($num_slides == '') {
@@ -2221,7 +2258,7 @@ function cpt_slider_style_content($post) {
2221
  $start_pos = 1;
2222
  }
2223
  $tooltip = "Which slide number to start display first";
2224
- echo "<div id='sa_window_onload_line'>";
2225
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Starting Slide Number:</span>";
2226
  echo "<select name='sa_start_pos'>";
2227
  for ($i = 1; $i <= $num_slides; $i++) {
@@ -2272,7 +2309,7 @@ function cpt_slider_style_content($post) {
2272
  }
2273
  echo "</select>\n";
2274
  echo "</div>\n"; // .bg_image_size_wrapper
2275
-
2276
  echo "</div>\n";
2277
  }
2278
 
@@ -2918,6 +2955,11 @@ function cpt_slider_save_postdata() {
2918
  } else {
2919
  $other_settings .= "|full";
2920
  }
 
 
 
 
 
2921
  update_post_meta($post->ID, 'sa_other_settings', $other_settings);
2922
  // starting slide number
2923
  update_post_meta($post->ID, 'sa_start_pos', abs(intval($_POST['sa_start_pos']))); // SANATIZE
912
 
913
  // ###### LOOP TO DISPLAY INPUT ELEMENTS FOR EACH SLIDE ######
914
  echo "<div id='slider_accordion'>\n";
915
+
916
+ // determine whether to use css classes instead of csss ids
917
+ $use_classes = 0;
918
+ $other_settings = get_post_meta($post->ID, 'sa_other_settings', true);
919
+ if ($other_settings != '') {
920
+ $other_settings_arr = explode("|", $other_settings);
921
+ }
922
+ if (isset($other_settings_arr) && (count($other_settings_arr) > 7)) {
923
+ $disable_slide_ids = $other_settings_arr[7];
924
+ } else {
925
+ $disable_slide_ids = '0';
926
+ }
927
+ if ($disable_slide_ids == '1') {
928
+ $use_classes = 1;
929
+ }
930
+
931
  for ($i = 0; $i < count($slide_data); $i++) {
932
  // DISPLAY ACCORDION HEADING
933
  echo "<h3>Slide ".$slide_data[$i]['slide_no'];
934
  $css_id = $slider_css_id."_slide".sprintf('%02d', $slide_data[$i]['slide_no']);
935
+ // display CSS ID/CLASS for the current slide
936
+ if ($use_classes == 1) {
937
+ echo "<span>.".$css_id."</span>";
938
+ } else {
939
+ echo "<span>#".$css_id."</span>";
940
+ }
941
  echo "</h3>\n";
942
  echo "<div>\n";
943
 
2151
  }
2152
  // setting 7 - bg_image_size
2153
  $bg_image_size = 'full';
2154
+ if (isset($other_settings_arr) && (count($other_settings_arr) > 6)) {
2155
  if ($other_settings_arr[6] != '') {
2156
  $bg_image_size = $other_settings_arr[6];
2157
  }
2158
  }
2159
+ // setting 8 - sa_disable_slide_ids
2160
+ if (isset($other_settings_arr) && (count($other_settings_arr) > 7)) {
2161
+ $disable_slide_ids = $other_settings_arr[7];
2162
+ } else {
2163
+ $disable_slide_ids = '0';
2164
+ }
2165
 
2166
  // USE 'DOMContentLoaded' EVENT (checkbox)
2167
  $tooltip = 'Load the Slide Anything JavaScript during the DOMContentLoaded event. Use this option if jQuery ';
2168
  $tooltip .= 'is loading in your theme footer and you are getting the JavaScript error message ';
2169
  $tooltip .= '&quot;Uncaught ReferenceError: jQuery is not defined&quot;.';
2170
+ echo "<div class='sa_window_onload_line'>";
2171
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>DOMContentLoaded event:</span>";
2172
  if ($window_onload == '1') {
2173
  echo "<input type='checkbox' id='sa_window_onload' name='sa_window_onload' value='1' checked/>";
2178
 
2179
  // Strip JavaScript from Content
2180
  $tooltip = 'Remove JavaScript (<script> tags) from slide content for extra security.';
2181
+ echo "<div class='sa_window_onload_line'>";
2182
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Remove JavaScript Content:</span>";
2183
  if ($strip_javascript == '1') {
2184
  echo "<input type='checkbox' id='sa_strip_javascript' name='sa_strip_javascript' value='1' checked/>";
2191
  // ##### REMOVE LAZY LOAD IMAGES FEATURE (WHICH IS NOW INCLUDED IN WP 5.5) #####
2192
  /*
2193
  $tooltip = "Enable &quot;Lazy Load&quot; for images added to your slide content (note: does not apply to slide backgrounds).";
2194
+ echo "<div class='sa_window_onload_line'>";
2195
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Enable 'Lazy Load' Images:</span>";
2196
  if ($lazy_load_images == '1') {
2197
  echo "<input type='checkbox' id='sa_lazy_load_images' name='sa_lazy_load_images' value='1' checked/>";
2206
 
2207
  // Use UL and LI Containers
2208
  $tooltip = "Use &quot;UL&quot; as the DOM element for &quot;owl-stage&quot; and use &quot;LI&quot; as the DOM elements for &quot;owl-item&quot;.";
2209
+ echo "<div class='sa_window_onload_line'>";
2210
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Use UL and LI Containers:</span>";
2211
  if ($ulli_containers == '1') {
2212
  echo "<input type='checkbox' id='sa_ulli_containers' name='sa_ulli_containers' value='1' checked/>";
2217
 
2218
  // Right to Left Slider
2219
  $tooltip = "Change the direction of the slider to be right to left.";
2220
+ echo "<div class='sa_window_onload_line'>";
2221
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Right to Left Slider:</span>";
2222
  if ($rtl_slider == '1') {
2223
  echo "<input type='checkbox' id='sa_rtl_slider' name='sa_rtl_slider' value='1' checked/>";
2228
 
2229
  // Disable Preview Feature
2230
  $tooltip = "Disable the &quot;Preview Slider&quot; feature in this settings page - the &quot;Slide Anything Popup Preview&quot; page will no longer be auto generated.";
2231
+ echo "<div class='sa_window_onload_line'>";
2232
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Disable Preview Feature:</span>";
2233
  if ($disable_preview == '1') {
2234
  echo "<input type='checkbox' id='sa_disable_preview' name='sa_disable_preview' value='1' checked/>";
2237
  }
2238
  echo "</div>\n";
2239
 
2240
+ // Don't use Slide IDs
2241
+ $tooltip = "Do not use a unique CSS ID to identify each slide container - use a unique CSS Class instead.";
2242
+ echo "<div class='sa_window_onload_line'>";
2243
+ echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Don't use CSS IDs for slides:</span>";
2244
+ if ($disable_slide_ids == '1') {
2245
+ echo "<input type='checkbox' id='sa_disable_slide_ids' name='sa_disable_slide_ids' value='1' checked/>";
2246
+ } else {
2247
+ echo "<input type='checkbox' id='sa_disable_slide_ids' name='sa_disable_slide_ids' value='1'/>";
2248
+ }
2249
+ echo "</div>\n";
2250
+
2251
  // Start Position
2252
  $num_slides = intval(get_post_meta($post->ID, 'sa_num_slides', true));
2253
  if ($num_slides == '') {
2258
  $start_pos = 1;
2259
  }
2260
  $tooltip = "Which slide number to start display first";
2261
+ echo "<div class='sa_window_onload_line'>";
2262
  echo "<span class='sa_tooltip' title='".$tooltip."'></span><span style='min-width:160px;'>Starting Slide Number:</span>";
2263
  echo "<select name='sa_start_pos'>";
2264
  for ($i = 1; $i <= $num_slides; $i++) {
2309
  }
2310
  echo "</select>\n";
2311
  echo "</div>\n"; // .bg_image_size_wrapper
2312
+
2313
  echo "</div>\n";
2314
  }
2315
 
2955
  } else {
2956
  $other_settings .= "|full";
2957
  }
2958
+ if (isset($_POST['sa_disable_slide_ids']) && ($_POST['sa_disable_slide_ids'] == '1')) {
2959
+ $other_settings .= "|1";
2960
+ } else {
2961
+ $other_settings .= "|0";
2962
+ }
2963
  update_post_meta($post->ID, 'sa_other_settings', $other_settings);
2964
  // starting slide number
2965
  update_post_meta($post->ID, 'sa_start_pos', abs(intval($_POST['sa_start_pos']))); // SANATIZE
php/slide-anything-frontend.php CHANGED
@@ -365,11 +365,18 @@ function slide_anything_shortcode($atts) {
365
  }
366
  // setting 7 - bg_image_size
367
  $slide_data['bg_image_size'] = 'full';
368
- if (isset($other_settings_arr) && (count($other_settings_arr)) > 6) {
369
  if ($other_settings_arr[6] != '') {
370
  $slide_data['bg_image_size'] = $other_settings_arr[6];
371
  }
372
  }
 
 
 
 
 
 
 
373
  // Start Position
374
  $slide_data['start_pos'] = 0;
375
  if (isset($metadata['sa_start_pos'])) {
@@ -695,10 +702,18 @@ function slide_anything_shortcode($atts) {
695
  //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
696
  //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
697
  $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
698
- if ($slide_data['vert_center'] == 'true') {
699
- $output .= "<div id='".$css_id."' class='sa_hover_container sa_vert_center_wrap' style='".esc_attr($slide_style)."'>";
 
 
 
 
700
  } else {
701
- $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
 
 
 
 
702
  }
703
  if (($link_output != '') || ($popup_output != '')) {
704
  if ($slide_data['slide_icons_location'] == 'Top Left') {
365
  }
366
  // setting 7 - bg_image_size
367
  $slide_data['bg_image_size'] = 'full';
368
+ if (isset($other_settings_arr) && (count($other_settings_arr) > 6)) {
369
  if ($other_settings_arr[6] != '') {
370
  $slide_data['bg_image_size'] = $other_settings_arr[6];
371
  }
372
  }
373
+ // setting 8 - disable_slide_ids
374
+ $slide_data['disable_slide_ids'] = '0';
375
+ if (isset($other_settings_arr) && (count($other_settings_arr) > 7)) {
376
+ if ($other_settings_arr[7] != '') {
377
+ $slide_data['disable_slide_ids'] = $other_settings_arr[7];
378
+ }
379
+ }
380
  // Start Position
381
  $slide_data['start_pos'] = 0;
382
  if (isset($metadata['sa_start_pos'])) {
702
  //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
703
  //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
704
  $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
705
+ if ($slide_data['disable_slide_ids'] == '1') {
706
+ if ($slide_data['vert_center'] == 'true') {
707
+ $output .= "<div class='".$css_id." sa_hover_container sa_vert_center_wrap' style='".esc_attr($slide_style)."'>";
708
+ } else {
709
+ $output .= "<div class='".$css_id." sa_hover_container' style='".esc_attr($slide_style)."'>";
710
+ }
711
  } else {
712
+ if ($slide_data['vert_center'] == 'true') {
713
+ $output .= "<div id='".$css_id."' class='sa_hover_container sa_vert_center_wrap' style='".esc_attr($slide_style)."'>";
714
+ } else {
715
+ $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
716
+ }
717
  }
718
  if (($link_output != '') || ($popup_output != '')) {
719
  if ($slide_data['slide_icons_location'] == 'Top Left') {
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.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -98,6 +98,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
98
 
99
  == Changelog ==
100
 
 
 
 
101
  = 2.3.41 =
102
  * A security fix to remove a vunerability to SQL injection with the slide duplication function.
103
 
@@ -740,3 +743,6 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
740
 
741
  = 2.3.41 =
742
  * A security fix to remove a vunerability to SQL injection with the slide duplication function.
 
 
 
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.9.3
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
98
 
99
  == Changelog ==
100
 
101
+ = 2.3.42 =
102
+ * Added a new option 'Don't use CSS IDs for slides' - when checked CSS Classes will be used instead of CSS IDs to identify each slide container.
103
+
104
  = 2.3.41 =
105
  * A security fix to remove a vunerability to SQL injection with the slide duplication function.
106
 
743
 
744
  = 2.3.41 =
745
  * A security fix to remove a vunerability to SQL injection with the slide duplication function.
746
+
747
+ = 2.3.42 =
748
+ * Added a new option 'Don't use CSS IDs for slides' - when checked CSS Classes will be used instead of CSS IDs to identify each slide container.
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.41
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.42
8
  * License: GPLv2 or later
9
  */
10