From 10a4c791e64850191d6078f4164f26487657f28a Mon Sep 17 00:00:00 2001 From: Eslam Saeed Date: Mon, 15 Jan 2024 15:21:54 +0200 Subject: [PATCH] add rtl option to shortcode attributes for slick slider settings --- lib/shortcodes/class-carousel.php | 2 ++ lib/shortcodes/class-product-carousel.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/shortcodes/class-carousel.php b/lib/shortcodes/class-carousel.php index e8da607..13a75fd 100644 --- a/lib/shortcodes/class-carousel.php +++ b/lib/shortcodes/class-carousel.php @@ -15,6 +15,7 @@ public static function carousel_shortcode( $atts ) { 'items' => '10', 'items_to_show' => '5', 'items_to_scroll' => '1', + 'rtl' => 'false', 'image_size' => 'thumbnail', 'autoplay' => 'false', 'arrows' => 'false', @@ -55,6 +56,7 @@ private static function slick_settings() { 'slidesToScroll' => (int) self::$atts['items_to_scroll'], 'autoplay' => ( 'true' === self::$atts['autoplay'] ) ? true : false, 'arrows' => ( 'true' === self::$atts['arrows'] ) ? true : false, + 'rtl' => ( 'true' === self::$atts['rtl'] ) ? true : false, ); return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' ); diff --git a/lib/shortcodes/class-product-carousel.php b/lib/shortcodes/class-product-carousel.php index 6363ea1..0470fdd 100644 --- a/lib/shortcodes/class-product-carousel.php +++ b/lib/shortcodes/class-product-carousel.php @@ -19,6 +19,7 @@ public static function product_carousel_shortcode( $atts ) { 'products_to_scroll' => '1', 'autoplay' => 'false', 'arrows' => 'false', + 'rtl' => 'false', ), $atts, 'pwb-product-carousel' @@ -52,6 +53,7 @@ private static function slick_settings() { 'slidesToScroll' => (int) self::$atts['products_to_scroll'], 'autoplay' => ( 'true' === self::$atts['autoplay'] ) ? true : false, 'arrows' => ( 'true' === self::$atts['arrows'] ) ? true : false, + 'rtl' => ( 'true' === self::$atts['rtl'] ) ? true : false, ); return htmlspecialchars( json_encode( $slick_settings ), ENT_QUOTES, 'UTF-8' );