Plugin Directory

Changeset 3351312


Ignore:
Timestamp:
08/27/2025 03:06:47 PM (6 months ago)
Author:
wpcoder75
Message:
  • Fixed marquee slider animation glitch on mobile devices
  • Fixed responsive layout issues in Review Carousel widget
  • Fixed compatibility issues with latest WordPress version
Location:
daily-slider
Files:
33 added
8 edited

Legend:

Unmodified
Added
Removed
  • daily-slider/trunk/assets/css/widgets/eldorado.css

    r3345410 r3351312  
    33  --navigation-horizontal-spacing: -80px;
    44  --pagination-vertical-spacing: 70px;
     5  width: 100%;
     6  max-width: 100%;
     7  margin: 0 auto;
     8  padding: 0;
    59  .daily-eldorado-wrap {
    610    position: relative;
     11    width: 100%;
     12    max-width: 100%;
     13    margin: 0 auto;
     14    overflow: hidden;
    715  }
    816
    9   .daily-slide-item {
     17  .swiper-slide {
    1018    height: 300px;
    1119    &.swiper-slide-active,
     
    8593    }
    8694  }
     95 
    8796  .daily-nav-button {
    8897    position: absolute;
     
    97106    top: 50%;
    98107    transform: translateY(-50%);
    99     &.daily-button-prev {
    100       left: 10px;
    101     }
    102     &.daily-button-next {
    103       right: 10px;
     108    width: auto;
     109    height: auto;
     110    margin-top: 0;
     111    &::after {
     112      display: none;
    104113    }
    105114    &::before {
     
    129138        transform: scale(1);
    130139      }
     140    }
     141   
     142    &.daily-button-prev {
     143      left: 0;
     144    }
     145   
     146    &.daily-button-next {
     147      right: 0;
    131148    }
    132149  }
  • daily-slider/trunk/assets/js/widgets/eldorado.js

    r3230738 r3351312  
    1 (function ($, elementor) {
     1(function ($) {
    22  "use strict";
    33
     
    1010
    1111    var $carouselContainer = $carousel.find(".swiper"),
    12       $settings = $carousel.data("settings");
     12        $settings = $carousel.data("settings"),
     13        $prevButton = $carousel.find('.daily-button-prev'),
     14        $nextButton = $carousel.find('.daily-button-next'),
     15        $pagination = $carousel.find('.daily-pagination');
    1316
    14     const Swiper = elementorFrontend.utils.swiper;
     17    if (!$settings) {
     18      console.error("Slider settings not found!");
     19      return;
     20    }
     21
     22    // First try to use window.Swiper (direct), then fallback to Elementor's Swiper
     23    var Swiper = window.Swiper;
     24   
     25    if (!Swiper && typeof elementorFrontend !== 'undefined') {
     26      if (elementorFrontend.utils && elementorFrontend.utils.swiper) {
     27        Swiper = elementorFrontend.utils.swiper;
     28      }
     29    }
     30   
     31    if (!Swiper) {
     32      console.error("Swiper not found! Make sure Swiper is properly loaded.");
     33      return;
     34    }
     35
     36    // Update settings with navigation and pagination elements
     37    if ($settings) {
     38      if ($settings.navigation && $settings.navigation === true) {
     39        $settings.navigation = {
     40          nextEl: $nextButton[0],
     41          prevEl: $prevButton[0],
     42        };
     43      }
     44     
     45      if ($settings.pagination && $settings.pagination === true) {
     46        $settings.pagination = {
     47          el: $pagination[0],
     48          clickable: true,
     49        };
     50      }
     51    }
     52   
    1553    initSwiper();
    1654    async function initSwiper() {
    17       var swiper = await new Swiper($carouselContainer, $settings);
     55      try {
     56        var swiper = await new Swiper($carouselContainer[0], $settings);
    1857
    19       if ($settings.pauseOnHover) {
    20         $($carouselContainer).hover(
    21           function () {
    22             this.swiper.autoplay.stop();
    23           },
    24           function () {
    25             this.swiper.autoplay.start();
    26           }
    27         );
     58        if ($settings && $settings.pauseOnHover) {
     59          $($carouselContainer).hover(
     60            function () {
     61              if (swiper && swiper.autoplay) swiper.autoplay.stop();
     62            },
     63            function () {
     64              if (swiper && swiper.autoplay) swiper.autoplay.start();
     65            }
     66          );
     67        }
     68      } catch (error) {
     69        console.error("Error initializing Swiper:", error);
    2870      }
    2971    }
    3072  };
    3173
    32   jQuery(window).on("elementor/frontend/init", function () {
     74  // Initialize in Elementor editor
     75  if (typeof elementorFrontend !== 'undefined' && elementorFrontend.isEditMode()) {
     76    // Make sure hooks are available before trying to use them
     77    if (elementorFrontend.hooks) {
     78      elementorFrontend.hooks.addAction(
     79        "frontend/element_ready/daily-slider-eldorado.default",
     80        widgetDailySlider
     81      );
     82     
     83      // Also initialize for widgets already in the DOM
     84      $(document).ready(function() {
     85        $(".elementor-widget-daily-slider-eldorado").each(function() {
     86          widgetDailySlider($(this), $);
     87        });
     88      });
     89    } else {
     90      // If hooks aren't available yet, wait for them
     91      $(window).on("elementor/frontend/init", function() {
     92        elementorFrontend.hooks.addAction(
     93          "frontend/element_ready/daily-slider-eldorado.default",
     94          widgetDailySlider
     95        );
     96      });
     97    }
     98  }
     99
     100  // Initialize on frontend (both in Elementor and regular themes)
     101  $(window).on("elementor/frontend/init", function () {
    33102    elementorFrontend.hooks.addAction(
    34103      "frontend/element_ready/daily-slider-eldorado.default",
     
    36105    );
    37106  });
    38 })(jQuery, window.elementorFrontend);
     107 
     108  // Fallback initialization for non-Elementor themes
     109  $(document).ready(function() {
     110    // Only run this if we're not in Elementor
     111    if (typeof elementorFrontend === 'undefined' || !elementorFrontend.isEditMode()) {
     112      $(".ds-eldorado").each(function() {
     113        widgetDailySlider($(this).closest('.elementor-widget-daily-slider-eldorado'), $);
     114      });
     115    }
     116  });
     117})(jQuery);
  • daily-slider/trunk/assets/js/widgets/marquee.js

    r3345410 r3351312  
    1 (function ($, elementor) {
     1(function ($) {
    22  "use strict";
    33
     
    158158  };
    159159
    160   // Register widget handler
    161   jQuery(window).on("elementor/frontend/init", function () {
     160  // Initialize in Elementor editor
     161  if (typeof elementorFrontend !== 'undefined' && elementorFrontend.isEditMode()) {
     162    // Make sure hooks are available before trying to use them
     163    if (elementorFrontend.hooks) {
     164      elementorFrontend.hooks.addAction(
     165        "frontend/element_ready/daily-slider-marquee.default",
     166        MarqueeHandler
     167      );
     168     
     169      // Also initialize for widgets already in the DOM
     170      $(document).ready(function() {
     171        $(".elementor-widget-daily-slider-marquee").each(function() {
     172          MarqueeHandler($(this), $);
     173        });
     174      });
     175    } else {
     176      // If hooks aren't available yet, wait for them
     177      $(window).on("elementor/frontend/init", function() {
     178        elementorFrontend.hooks.addAction(
     179          "frontend/element_ready/daily-slider-marquee.default",
     180          MarqueeHandler
     181        );
     182      });
     183    }
     184  }
     185
     186  // Initialize on frontend (both in Elementor and regular themes)
     187  $(window).on("elementor/frontend/init", function () {
    162188    elementorFrontend.hooks.addAction(
    163189      "frontend/element_ready/daily-slider-marquee.default",
     
    165191    );
    166192  });
    167 })(jQuery, window.elementorFrontend);
     193 
     194  // Fallback initialization for non-Elementor themes
     195  $(document).ready(function() {
     196    // Only run this if we're not in Elementor
     197    if (typeof elementorFrontend === 'undefined' || !elementorFrontend.isEditMode()) {
     198      $(".daily-slider-marquee-slider").each(function() {
     199        try {
     200          new widgetDailySlider(this);
     201        } catch (error) {
     202          console.error('Marquee Slider Error:', error);
     203        }
     204      });
     205    }
     206  });
     207})(jQuery);
  • daily-slider/trunk/assets/js/widgets/pixel.js

    r3230738 r3351312  
    1 (function ($, elementor) {
     1(function ($) {
    22  "use strict";
    33
     
    1010
    1111    var $carouselContainer = $carousel.find(".swiper"),
    12       $settings = $carousel.data("settings");
     12        $settings = $carousel.data("settings");
    1313
    14     const Swiper = elementorFrontend.utils.swiper;
     14    if (!$settings) {
     15      console.error("Slider settings not found!");
     16      return;
     17    }
     18
     19    // First try to use window.Swiper (direct), then fallback to Elementor's Swiper
     20    var Swiper = window.Swiper;
     21   
     22    if (!Swiper && typeof elementorFrontend !== 'undefined') {
     23      if (elementorFrontend.utils && elementorFrontend.utils.swiper) {
     24        Swiper = elementorFrontend.utils.swiper;
     25      }
     26    }
     27   
     28    if (!Swiper) {
     29      console.error("Swiper not found! Make sure Swiper is properly loaded.");
     30      return;
     31    }
     32
    1533    initSwiper();
    1634    async function initSwiper() {
    17       var swiper = await new Swiper($carouselContainer, $settings);
     35      try {
     36        var swiper = await new Swiper($carouselContainer[0], $settings);
    1837
    19       if ($settings.pauseOnHover) {
    20         $($carouselContainer).hover(
    21           function () {
    22             this.swiper.autoplay.stop();
    23           },
    24           function () {
    25             this.swiper.autoplay.start();
    26           }
    27         );
     38        if ($settings && $settings.pauseOnHover) {
     39          $($carouselContainer).hover(
     40            function () {
     41              if (swiper && swiper.autoplay) swiper.autoplay.stop();
     42            },
     43            function () {
     44              if (swiper && swiper.autoplay) swiper.autoplay.start();
     45            }
     46          );
     47        }
     48      } catch (error) {
     49        console.error("Error initializing Swiper:", error);
    2850      }
    2951    }
    3052  };
    3153
    32   jQuery(window).on("elementor/frontend/init", function () {
     54  // Initialize in Elementor editor
     55  if (typeof elementorFrontend !== 'undefined' && elementorFrontend.isEditMode()) {
     56    // Make sure hooks are available before trying to use them
     57    if (elementorFrontend.hooks) {
     58      elementorFrontend.hooks.addAction(
     59        "frontend/element_ready/daily-slider-pixel.default",
     60        widgetDailySlider
     61      );
     62     
     63      // Also initialize for widgets already in the DOM
     64      $(document).ready(function() {
     65        $(".elementor-widget-daily-slider-pixel").each(function() {
     66          widgetDailySlider($(this), $);
     67        });
     68      });
     69    } else {
     70      // If hooks aren't available yet, wait for them
     71      $(window).on("elementor/frontend/init", function() {
     72        elementorFrontend.hooks.addAction(
     73          "frontend/element_ready/daily-slider-pixel.default",
     74          widgetDailySlider
     75        );
     76      });
     77    }
     78  }
     79
     80  // Initialize on frontend (both in Elementor and regular themes)
     81  $(window).on("elementor/frontend/init", function () {
    3382    elementorFrontend.hooks.addAction(
    3483      "frontend/element_ready/daily-slider-pixel.default",
     
    3685    );
    3786  });
    38 })(jQuery, window.elementorFrontend);
     87 
     88  // Fallback initialization for non-Elementor themes
     89  $(document).ready(function() {
     90    // Only run this if we're not in Elementor
     91    if (typeof elementorFrontend === 'undefined' || !elementorFrontend.isEditMode()) {
     92      $(".ds-pixel-slider").each(function() {
     93        widgetDailySlider($(this).closest('.elementor-widget-daily-slider-pixel'), $);
     94      });
     95    }
     96  });
     97
     98})(jQuery);
  • daily-slider/trunk/assets/js/widgets/review-carousel.js

    r3230738 r3351312  
    1 (function ($, elementor) {
     1(function ($) {
    22  "use strict";
    33
     
    1010
    1111    var $carouselContainer = $carousel.find(".swiper"),
    12       $settings = $carousel.data("settings");
     12        $settings = $carousel.data("settings");
    1313
    14     const Swiper = elementorFrontend.utils.swiper;
     14    if (!$settings) {
     15      console.error("Slider settings not found!");
     16      return;
     17    }
     18
     19    // First try to use window.Swiper (direct), then fallback to Elementor's Swiper
     20    var Swiper = window.Swiper;
     21   
     22    if (!Swiper && typeof elementorFrontend !== 'undefined') {
     23      if (elementorFrontend.utils && elementorFrontend.utils.swiper) {
     24        Swiper = elementorFrontend.utils.swiper;
     25      }
     26    }
     27   
     28    if (!Swiper) {
     29      console.error("Swiper not found! Make sure Swiper is properly loaded.");
     30      return;
     31    }
     32
    1533    initSwiper();
    1634    async function initSwiper() {
    17       var swiper = await new Swiper($carouselContainer, $settings);
     35      try {
     36        var swiper = await new Swiper($carouselContainer[0], $settings);
    1837
    19       if ($settings.pauseOnHover) {
    20         $($carouselContainer).hover(
    21           function () {
    22             this.swiper.autoplay.stop();
    23           },
    24           function () {
    25             this.swiper.autoplay.start();
    26           }
    27         );
     38        if ($settings && $settings.pauseOnHover) {
     39          $($carouselContainer).hover(
     40            function () {
     41              if (swiper && swiper.autoplay) swiper.autoplay.stop();
     42            },
     43            function () {
     44              if (swiper && swiper.autoplay) swiper.autoplay.start();
     45            }
     46          );
     47        }
     48      } catch (error) {
     49        console.error("Error initializing Swiper:", error);
    2850      }
    2951    }
    3052  };
    3153
    32   jQuery(window).on("elementor/frontend/init", function () {
     54  // Initialize in Elementor editor
     55  if (typeof elementorFrontend !== 'undefined' && elementorFrontend.isEditMode()) {
     56    // Make sure hooks are available before trying to use them
     57    if (elementorFrontend.hooks) {
     58      elementorFrontend.hooks.addAction(
     59        "frontend/element_ready/daily-slider-review-carousel.default",
     60        widgetDailySlider
     61      );
     62     
     63      // Also initialize for widgets already in the DOM
     64      $(document).ready(function() {
     65        $(".elementor-widget-daily-slider-review-carousel").each(function() {
     66          widgetDailySlider($(this), $);
     67        });
     68      });
     69    } else {
     70      // If hooks aren't available yet, wait for them
     71      $(window).on("elementor/frontend/init", function() {
     72        elementorFrontend.hooks.addAction(
     73          "frontend/element_ready/daily-slider-review-carousel.default",
     74          widgetDailySlider
     75        );
     76      });
     77    }
     78  }
     79
     80  // Initialize on frontend (both in Elementor and regular themes)
     81  $(window).on("elementor/frontend/init", function () {
    3382    elementorFrontend.hooks.addAction(
    3483      "frontend/element_ready/daily-slider-review-carousel.default",
     
    3685    );
    3786  });
    38 })(jQuery, window.elementorFrontend);
     87 
     88  // Fallback initialization for non-Elementor themes
     89  $(document).ready(function() {
     90    // Only run this if we're not in Elementor
     91    if (typeof elementorFrontend === 'undefined' || !elementorFrontend.isEditMode()) {
     92      $(".ds-review-carousel").each(function() {
     93        widgetDailySlider($(this).closest('.elementor-widget-daily-slider-review-carousel'), $);
     94      });
     95    }
     96  });
     97})(jQuery);
  • daily-slider/trunk/daily-slider.php

    r3345410 r3351312  
    33 * Plugin Name: Daily Slider
    44 * Description: Enhance Elementor with customizable hero sliders, review carousels, and portfolio showcases, featuring responsive design, animations, and hover effects.
    5  * Version: 1.6
     5 * Version: 1.7.0
    66 * Author: wpcoder75
    77 * Author URI: https://github.com/asikwp75
     
    1919
    2020class DailySliderPlugin {
    21     const VERSION = '1.6';
     21    const VERSION = '1.7.0';
    2222    const MINIMUM_ELEMENTOR_VERSION = '3.26.0';
    2323    const MINIMUM_PHP_VERSION = '7.4';
     
    5656        add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'enqueue_styles' ) );
    5757        add_action( 'elementor/frontend/after_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     58       
     59        // Add scripts for Elementor editor
     60        add_action( 'elementor/editor/after_enqueue_scripts', array( $this, 'enqueue_editor_scripts' ) );
    5861    }
    5962
    6063    public function enqueue_styles() {
     64        // Use Elementor's Swiper CSS
     65       
    6166        wp_enqueue_style( 'DailySlider-eldorado-styles', plugins_url( 'assets/css/widgets/eldorado.css', __FILE__ ), array(), '1.0.0', false );
    6267        wp_enqueue_style( 'DailySlider-pixel-styles', plugins_url( 'assets/css/widgets/pixel.css', __FILE__ ), array(), '1.0.0', false );
    6368        wp_enqueue_style( 'DailySlider-review-carousel-styles', plugins_url( 'assets/css/widgets/review-carousel.css', __FILE__ ), array(), '1.0.0', false );
    64         wp_enqueue_style( 'DailySlider-marquee-styles', plugins_url( 'assets/css/widgets/marqee.css', __FILE__ ), array(), '1.0.0', false );
     69        wp_enqueue_style( 'DailySlider-marquee-styles', plugins_url( 'assets/css/widgets/marquee.css', __FILE__ ), array(), '1.0.0', false );
    6570        wp_enqueue_style( 'DailySlider-common-styles', plugins_url( 'assets/css/common.css', __FILE__ ), array(), '1.0.0', false );
    6671    }
    6772
    6873    public function enqueue_scripts() {
    69         wp_enqueue_script( 'DailySlider-eldorado-scripts', plugins_url( 'assets/js/widgets/eldorado.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
    70         wp_enqueue_script( 'DailySlider-pixel-scripts', plugins_url( 'assets/js/widgets/pixel.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
    71         wp_enqueue_script( 'DailySlider-review-carousel-scripts', plugins_url( 'assets/js/widgets/review-carousel.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
    72         wp_enqueue_script( 'DailySlider-marquee-scripts', plugins_url( 'assets/js/widgets/marquee.js', __FILE__ ), array( 'jquery' ), '1.0.0', true );
     74        // Use Elementor's Swiper JS
     75       
     76        wp_enqueue_script( 'DailySlider-eldorado-scripts', plugins_url( 'assets/js/widgets/eldorado.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     77        wp_enqueue_script( 'DailySlider-pixel-scripts', plugins_url( 'assets/js/widgets/pixel.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     78        wp_enqueue_script( 'DailySlider-review-carousel-scripts', plugins_url( 'assets/js/widgets/review-carousel.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     79        wp_enqueue_script( 'DailySlider-marquee-scripts', plugins_url( 'assets/js/widgets/marquee.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     80    }
     81   
     82    /**
     83     * Enqueue scripts for Elementor editor
     84     */
     85    public function enqueue_editor_scripts() {
     86        // Use Elementor's Swiper in the editor
     87       
     88        // Enqueue widget scripts for editor
     89        wp_enqueue_script( 'DailySlider-eldorado-scripts', plugins_url( 'assets/js/widgets/eldorado.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     90        wp_enqueue_script( 'DailySlider-pixel-scripts', plugins_url( 'assets/js/widgets/pixel.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     91        wp_enqueue_script( 'DailySlider-review-carousel-scripts', plugins_url( 'assets/js/widgets/review-carousel.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     92        wp_enqueue_script( 'DailySlider-marquee-scripts', plugins_url( 'assets/js/widgets/marquee.js', __FILE__ ), array( 'jquery', 'elementor-frontend' ), '1.0.0', true );
     93       
     94        // Enqueue widget styles for editor
     95        wp_enqueue_style( 'DailySlider-eldorado-styles', plugins_url( 'assets/css/widgets/eldorado.css', __FILE__ ), array(), '1.0.0', false );
     96        wp_enqueue_style( 'DailySlider-pixel-styles', plugins_url( 'assets/css/widgets/pixel.css', __FILE__ ), array(), '1.0.0', false );
     97        wp_enqueue_style( 'DailySlider-review-carousel-styles', plugins_url( 'assets/css/widgets/review-carousel.css', __FILE__ ), array(), '1.0.0', false );
     98        wp_enqueue_style( 'DailySlider-marquee-styles', plugins_url( 'assets/css/widgets/marquee.css', __FILE__ ), array(), '1.0.0', false );
     99        wp_enqueue_style( 'DailySlider-common-styles', plugins_url( 'assets/css/common.css', __FILE__ ), array(), '1.0.0', false );
    73100    }
    74101
  • daily-slider/trunk/readme.txt

    r3345410 r3351312  
    11=== Daily Slider ===
    22Contributors: wpcoder75
    3 Tags: elementor, slider, carousel, marquee, hero-slider, testimonial, portfolio, animation, responsive, widgets, addon
     3Tags: elementor, slider, carousel, marquee, hero-slider
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable Tag: 1.6
     6Stable Tag: 1.7.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    6666
    6767== Changelog ==
     68= 1.7.0 [27th August 2025] =
    6869
    69 = 1.6 [31th January 2025] =
     70- Fixed marquee slider animation glitch on mobile devices
     71- Fixed responsive layout issues in Review Carousel widget
     72- Fixed compatibility issues with latest WordPress version
     73
     74
     75= 1.7.0 [31th January 2025] =
    7076
    7177- Added **Marquee Slider Widget** with smooth scrolling animations, customizable speed, direction, and pause on hover functionality.
  • daily-slider/trunk/widgets/pixel/pixel.php

    r3230738 r3351312  
    12831283
    12841284        $id = 'ds-' . $this->get_id();
    1285 
     1285       
     1286        // Prepare Swiper settings array
     1287        $swiper_settings = [
     1288            'effect' => esc_attr($settings['swiper_effect'] ?? 'slide'),
     1289            'loop' => !empty($settings['swiper_loop']) && $settings['swiper_loop'] === 'yes',
     1290            'speed' => absint($settings['swiper_speed'] ?? 800),
     1291            'parallax' => true,
     1292            'pauseOnHover' => !empty($settings['swiper_pause_on_hover']) && $settings['swiper_pause_on_hover'] === 'yes',
     1293        ];
     1294       
     1295        // Add autoplay settings if enabled
     1296        if (!empty($settings['swiper_autoplay']) && $settings['swiper_autoplay'] === 'yes') {
     1297            $swiper_settings['autoplay'] = [
     1298                'delay' => absint($settings['swiper_autoplay_delay'] ?? 5000),
     1299                'disableOnInteraction' => false,
     1300            ];
     1301        }
     1302       
     1303        // Add cube effect settings if applicable
     1304        if ($settings['swiper_effect'] === 'cube') {
     1305            $swiper_settings['cubeEffect'] = [
     1306                'shadow' => !empty($settings['swiper_cube_shadow']) && $settings['swiper_cube_shadow'] === 'yes',
     1307                'slideShadows' => !empty($settings['swiper_slide_shadows']) && $settings['swiper_slide_shadows'] === 'yes',
     1308                'shadowOffset' => absint($settings['swiper_shadow_offset'] ?? 20),
     1309                'shadowScale' => floatval($settings['swiper_shadow_scale'] ?? 0.94),
     1310            ];
     1311        }
     1312       
     1313        // Add navigation settings
     1314        $swiper_settings['navigation'] = [
     1315            'nextEl' => "#" . $id . " .daily-button-next",
     1316            'prevEl' => "#" . $id . " .daily-button-prev",
     1317        ];
     1318       
     1319        // Add pagination settings
     1320        $swiper_settings['pagination'] = [
     1321            'el' => "#" . $id . " .swiper-pagination",
     1322            'type' => 'bullets',
     1323            'clickable' => true,
     1324            'dynamicBullets' => false,
     1325        ];
     1326       
    12861327        $this->add_render_attribute(
    1287             [
    1288                 'carousel' => [
     1328            [
     1329                'carousel' => [
    12891330                    'class' => 'ds-pixel-slider',
    12901331                    'id' => $id,
    1291                     'data-settings' => [
    1292                         wp_json_encode( array_filter( [
    1293                             'effect' => esc_attr($settings['swiper_effect'] ?? 'slide'),
    1294                             'loop' => !empty($settings['swiper_loop']) && $settings['swiper_loop'] === 'yes',
    1295                             'autoplay' => !empty($settings['swiper_autoplay']) && $settings['swiper_autoplay'] === 'yes' ? [
    1296                                 'delay' => absint($settings['swiper_autoplay_delay'] ?? 5000),
    1297                             ] : false,
    1298                             'speed' => absint($settings['swiper_speed'] ?? 800),
    1299                             'parallax' => true,
    1300                             'cubeEffect' => [
    1301                                 'shadow' => !empty($settings['swiper_cube_shadow']) && $settings['swiper_cube_shadow'] === 'yes',
    1302                                 'slideShadows' => !empty($settings['swiper_slide_shadows']) && $settings['swiper_slide_shadows'] === 'yes',
    1303                                 'shadowOffset' => absint($settings['swiper_shadow_offset'] ?? 20),
    1304                                 'shadowScale' => floatval($settings['swiper_shadow_scale'] ?? 0.94),
    1305                             ],
    1306                             "navigation"            => [
    1307                                 "nextEl" => "#" . $id . " .daily-button-next",
    1308                                 "prevEl" => "#" . $id . " .daily-button-prev",
    1309                             ],
    1310                             "pagination"            => [
    1311                                 "el"             => "#" . $id . " .swiper-pagination",
    1312                                 "type"           => 'bullets',
    1313                                 "clickable"      => "true",
    1314                                 'dynamicBullets' => false,
    1315                             ],
    1316                        
    1317                         ] ) )
    1318                     ]
    1319                 ]
    1320             ]
    1321         );
     1332                    'data-settings' => wp_json_encode($swiper_settings)
     1333                ]
     1334            ]
     1335        );
    13221336
    13231337        ?>
Note: See TracChangeset for help on using the changeset viewer.