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

Version Description

  • Added a new feature (checkbox) to vertically center content within slides.

=

Download this release

Release Info

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

Code changes from version 2.3.11 to 2.3.12

owl-carousel/sa-owl-theme.css CHANGED
@@ -284,6 +284,16 @@
284
  .showcase_hide_mobile { width:100% !important; left:0px !important; }
285
  }
286
 
 
 
 
 
 
 
 
 
 
 
287
  /* THUMBNAIL PAGINATION (SA PRO) */
288
  .sa_owl_thumbs_wrap {
289
  display:block !important;
284
  .showcase_hide_mobile { width:100% !important; left:0px !important; }
285
  }
286
 
287
+ /* VERTICAL CENTER SLIDE CONTENT FEATURE */
288
+ .sa_owl_theme .owl-item .sa_vert_center_wrap {
289
+ position:relative;
290
+ }
291
+ .sa_owl_theme .owl-item .sa_vert_center_wrap .sa_vert_center {
292
+ position:absolute;
293
+ top:50%;
294
+ transform:translate(0px,-50%);
295
+ }
296
+
297
  /* THUMBNAIL PAGINATION (SA PRO) */
298
  .sa_owl_thumbs_wrap {
299
  display:block !important;
php/slide-anything-admin.php CHANGED
@@ -80,6 +80,7 @@ function cpt_slider_plugin_activation() {
80
  update_post_meta($cpt_id, 'sa_mouse_drag', '0');
81
  update_post_meta($cpt_id, 'sa_touch_drag', '1');
82
  update_post_meta($cpt_id, 'sa_auto_height', '0');
 
83
  update_post_meta($cpt_id, 'sa_items_width1', 1);
84
  update_post_meta($cpt_id, 'sa_items_width2', 2);
85
  update_post_meta($cpt_id, 'sa_items_width3', 3);
@@ -586,6 +587,19 @@ function cpt_slider_settings_content($post) {
586
  }
587
  echo "<em class='sa_tooltip' href='' title='Include WordPree shorcodes within slide content. NOTE: Running shortcodes in Slide Anything may cause issues with some Wordpress Page Builders'></em>\n";
588
  echo "</div>\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  echo "</div>\n";
590
  echo "<div class='half_width_column'>\n";
591
  // NAVIGATE ARROWS
@@ -2493,6 +2507,11 @@ function cpt_slider_save_postdata() {
2493
  } else {
2494
  update_post_meta($post->ID, 'sa_auto_height', '0');
2495
  }
 
 
 
 
 
2496
 
2497
  // UPDATE SLIDER ITEMS DISPLAYED
2498
  update_post_meta($post->ID, 'sa_items_width1', abs(intval($_POST['sa_items_width1']))); // SANATIZE
80
  update_post_meta($cpt_id, 'sa_mouse_drag', '0');
81
  update_post_meta($cpt_id, 'sa_touch_drag', '1');
82
  update_post_meta($cpt_id, 'sa_auto_height', '0');
83
+ update_post_meta($cpt_id, 'sa_vert_center', '0');
84
  update_post_meta($cpt_id, 'sa_items_width1', 1);
85
  update_post_meta($cpt_id, 'sa_items_width2', 2);
86
  update_post_meta($cpt_id, 'sa_items_width3', 3);
587
  }
588
  echo "<em class='sa_tooltip' href='' title='Include WordPree shorcodes within slide content. NOTE: Running shortcodes in Slide Anything may cause issues with some Wordpress Page Builders'></em>\n";
589
  echo "</div>\n";
590
+ // VERTICAL CENTER
591
+ $vert_center = get_post_meta($post->ID, 'sa_vert_center', true);
592
+ if ($vert_center == '') {
593
+ $vert_center = '0';
594
+ }
595
+ echo "<div class='sa_setting_checkbox'><span>Vertical Center:</span>";
596
+ if ($vert_center == '1') {
597
+ echo "<input type='checkbox' id='sa_vert_center' name='sa_vert_center' value='1' checked/>";
598
+ } else {
599
+ echo "<input type='checkbox' id='sa_vert_center' name='sa_vert_center' value='1'/>";
600
+ }
601
+ echo "<em class='sa_tooltip' title='Vertically center content within slides. Only use this setting if you have set a Min Height for your slider (which sets a minimum height for each slide).'></em>";
602
+ echo "</div>\n";
603
  echo "</div>\n";
604
  echo "<div class='half_width_column'>\n";
605
  // NAVIGATE ARROWS
2507
  } else {
2508
  update_post_meta($post->ID, 'sa_auto_height', '0');
2509
  }
2510
+ if (isset($_POST['sa_vert_center']) && ($_POST['sa_vert_center'] == '1')) {
2511
+ update_post_meta($post->ID, 'sa_vert_center', '1');
2512
+ } else {
2513
+ update_post_meta($post->ID, 'sa_vert_center', '0');
2514
+ }
2515
 
2516
  // UPDATE SLIDER ITEMS DISPLAYED
2517
  update_post_meta($post->ID, 'sa_items_width1', abs(intval($_POST['sa_items_width1']))); // SANATIZE
php/slide-anything-frontend.php CHANGED
@@ -184,6 +184,20 @@ function slide_anything_shortcode($atts) {
184
  } else {
185
  $slide_data['auto_height'] = 'false';
186
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  $slide_data['items_width1'] = $metadata['sa_items_width1'][0];
188
  $slide_data['items_width2'] = $metadata['sa_items_width2'][0];
189
  $slide_data['items_width3'] = $metadata['sa_items_width3'][0];
@@ -553,7 +567,11 @@ function slide_anything_shortcode($atts) {
553
  //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
554
  //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
555
  $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
556
- $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
 
 
 
 
557
  if (($link_output != '') || ($popup_output != '')) {
558
  if ($slide_data['slide_icons_location'] == 'Top Left') {
559
  // icons location - top left
@@ -604,6 +622,11 @@ function slide_anything_shortcode($atts) {
604
  // modify images (<img> tag) within slide content to enable owl carousel lazy load
605
  $slide_content = set_slide_images_to_lazy_load($slide_content);
606
  }
 
 
 
 
 
607
  $output .= $slide_content."</div>\n"; // .sa_hover_container
608
  }
609
  $output .= "</div>\n"; // .owl-carousel
184
  } else {
185
  $slide_data['auto_height'] = 'false';
186
  }
187
+ if (($metadata['sa_slide_min_height_perc'][0] == '0') || ($metadata['sa_slide_min_height_perc'][0] == '0px')) {
188
+ $slide_data['vert_center'] = 'false';
189
+ } else {
190
+ if (isset($metadata['sa_vert_center'])) {
191
+ $slide_data['vert_center'] = $metadata['sa_vert_center'][0];
192
+ if ($slide_data['vert_center'] == '1') {
193
+ $slide_data['vert_center'] = 'true';
194
+ } else {
195
+ $slide_data['vert_center'] = 'false';
196
+ }
197
+ } else {
198
+ $slide_data['vert_center'] = 'false';
199
+ }
200
+ }
201
  $slide_data['items_width1'] = $metadata['sa_items_width1'][0];
202
  $slide_data['items_width2'] = $metadata['sa_items_width2'][0];
203
  $slide_data['items_width3'] = $metadata['sa_items_width3'][0];
567
  //$data_hash = $slide_data['css_id']."_slide".sprintf('%02d', $i);
568
  //$output .= "<div class='sa_hover_container' data-hash='".$data_hash."' style='".esc_attr($slide_style)."'>";
569
  $css_id = $slide_data['css_id']."_slide".sprintf('%02d', $slide_data["slide".$i."_num"]);
570
+ if ($slide_data['vert_center'] == 'true') {
571
+ $output .= "<div id='".$css_id."' class='sa_hover_container sa_vert_center_wrap' style='".esc_attr($slide_style)."'>";
572
+ } else {
573
+ $output .= "<div id='".$css_id."' class='sa_hover_container' style='".esc_attr($slide_style)."'>";
574
+ }
575
  if (($link_output != '') || ($popup_output != '')) {
576
  if ($slide_data['slide_icons_location'] == 'Top Left') {
577
  // icons location - top left
622
  // modify images (<img> tag) within slide content to enable owl carousel lazy load
623
  $slide_content = set_slide_images_to_lazy_load($slide_content);
624
  }
625
+ if ($slide_data['vert_center'] == 'true') {
626
+ // vertically center content within each slide
627
+ // (we do this by wrapping slide content in a '<div>' wrapper
628
+ $slide_content = "<div class='sa_vert_center'>".$slide_content."</div>";
629
+ }
630
  $output .= $slide_content."</div>\n"; // .sa_hover_container
631
  }
632
  $output .= "</div>\n"; // .owl-carousel
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.3.2
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -329,6 +329,9 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
329
  = 2.3.11 =
330
  * Couple of small bug fixes: Undefined index error for 'popup_shortcode' vairables and hide "SA PRO' advert for non-admin users.
331
 
 
 
 
332
  == Upgrade Notice ==
333
 
334
  = 1.0 =
@@ -559,4 +562,7 @@ Adding a SLIDE ANYTHING slider using the WordPress 5.0 'Block Editor' is pretty
559
  * Revamped the 'Preview Slider' feature, so that the preview popup container loads the front-end theme's javascript and css style files
560
 
561
  = 2.3.11 =
562
- * Couple of small bug fixes: Undefined index error for 'popup_shortcode' vairables and hide "SA PRO' advert for non-admin users.
 
 
 
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.4
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
329
  = 2.3.11 =
330
  * Couple of small bug fixes: Undefined index error for 'popup_shortcode' vairables and hide "SA PRO' advert for non-admin users.
331
 
332
+ = 2.3.12 =
333
+ * Added a new feature (checkbox) to vertically center content within slides.
334
+
335
  == Upgrade Notice ==
336
 
337
  = 1.0 =
562
  * Revamped the 'Preview Slider' feature, so that the preview popup container loads the front-end theme's javascript and css style files
563
 
564
  = 2.3.11 =
565
+ * Couple of small bug fixes: Undefined index error for 'popup_shortcode' vairables and hide "SA PRO' advert for non-admin users.
566
+
567
+ = 2.3.12 =
568
+ * Added a new feature (checkbox) to vertically center content within slides.
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.11
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.12
8
  * License: GPLv2 or later
9
  */
10