Changeset 3413265
- Timestamp:
- 12/06/2025 10:17:47 PM (2 months ago)
- Location:
- slide-crafter-reborn
- Files:
-
- 3 edited
- 8 copied
-
tags/1.1.1 (copied) (copied from slide-crafter-reborn/trunk)
-
tags/1.1.1/css/admin-enhanced.css (copied) (copied from slide-crafter-reborn/trunk/css/admin-enhanced.css)
-
tags/1.1.1/includes/ajax.php (copied) (copied from slide-crafter-reborn/trunk/includes/ajax.php)
-
tags/1.1.1/includes/meta-boxes.php (copied) (copied from slide-crafter-reborn/trunk/includes/meta-boxes.php)
-
tags/1.1.1/includes/shortcodes.php (copied) (copied from slide-crafter-reborn/trunk/includes/shortcodes.php) (1 diff)
-
tags/1.1.1/readme.txt (copied) (copied from slide-crafter-reborn/trunk/readme.txt) (2 diffs)
-
tags/1.1.1/slide-crafter-reborn.php (copied) (copied from slide-crafter-reborn/trunk/slide-crafter-reborn.php) (1 diff)
-
tags/1.1.1/uninstall.php (copied) (copied from slide-crafter-reborn/trunk/uninstall.php)
-
trunk/includes/shortcodes.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/slide-crafter-reborn.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
slide-crafter-reborn/tags/1.1.1/includes/shortcodes.php
r3413240 r3413265 5 5 $atts = shortcode_atts(['id' => ''], $atts, 'slidecrafterreborn_slide'); 6 6 $post_id = absint($atts['id']); 7 8 7 if (!$post_id || get_post_type($post_id) !== 'slcr_reborn_slide') { 8 error_log('Slide Crafter Reborn: Invalid or missing slide ID: ' . $post_id); 9 9 return '<p>' . esc_html__('Invalid or missing slide ID.', 'slide-crafter-reborn') . '</p>'; 10 10 } 11 11 12 12 $slide_data = get_option('slidecrafterreborn_slide_' . $post_id); 13 if (!$slide_data) return '<p>' . esc_html__('Slide not found.', 'slide-crafter-reborn') . '</p>'; 13 if (!$slide_data) { 14 error_log('Slide Crafter Reborn: Slide not found for ID: ' . $post_id); 15 return '<p>' . esc_html__('Slide not found.', 'slide-crafter-reborn') . '</p>'; 16 } 14 17 15 18 $slide = json_decode($slide_data, true); 16 if (!$slide || empty($slide['cards'])) return '<p>' . esc_html__('No cards defined for this slide.', 'slide-crafter-reborn') . '</p>'; 19 if (!$slide || !isset($slide['cards']) || empty($slide['cards'])) { 20 error_log('Slide Crafter Reborn: No cards defined for slide ID ' . $post_id); 21 return '<p>' . esc_html__('No cards defined for this slide.', 'slide-crafter-reborn') . '</p>'; 22 } 17 23 18 24 $settings = $slide['settings'] ?? []; 19 $cards = $slide['cards'];20 21 $slides_per_view = ($settings['animation_type'] ?? 'slide') === 'cube' ? 1 : ($settings['slides_per_view'] ?? 3);22 if (count($cards) < $slides_per_view)$slides_per_view = count($cards);23 25 $cards = $slide['cards']; 26 $slides_per_view = $settings['animation_type'] === 'cube' ? 1 : ($settings['slides_per_view'] ?? 3); 27 if (count($cards) < $slides_per_view) { 28 $slides_per_view = count($cards); 29 } 24 30 $unique_id = 'swiper-' . wp_generate_uuid4(); 25 31 26 32 wp_enqueue_style('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../css/swiper-bundle.css', [], '8.4.7'); 27 wp_enqueue_script('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../js/swiper-bundle.js', [], '8.4. ConcurrentLinkedDeque4.7', true);33 wp_enqueue_script('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../js/swiper-bundle.js', [], '8.4.7', true); 28 34 29 // CORRECTION CSS : appliqué au conteneur30 $custom_css = '';31 35 if (!empty($settings['custom_css'])) { 32 $ css = str_replace(33 ['body ', 'html ', 'body>', 'html>'],34 ['#' . $unique_id . ' ', '#' . $unique_id . ' ', '#' . $unique_id . '>', '#' . $unique_id . '>'],35 $settings['custom_css']36 );37 $css = preg_replace('/^\s*body\s*\{.*?\}\s*/is', '', $css);38 $sanitized = slidecrafterreborn_sanitize_css($css);39 if ($sanitized) $custom_css = "<style>#{$unique_id} { {$sanitized} }</style>";36 $sanitized_css = slidecrafterreborn_sanitize_css($settings['custom_css']); 37 if (!empty($sanitized_css)) { 38 $custom_css_style = "<style>#$unique_id .swiper-slide { $sanitized_css }</style>"; 39 } else { 40 $custom_css_style = ''; 41 } 42 } else { 43 $custom_css_style = ''; 40 44 } 45 46 error_log('Slide Crafter Reborn: Rendering slide ID ' . $post_id . ', cards count: ' . count($cards) . ', settings: ' . json_encode($settings)); 41 47 42 48 ob_start(); 43 49 ?> 44 <div class="swiper slidecrafterreborn-slider slidecrafterreborn-slider-<?php echo esc_attr($post_id); ?>" 45 id="<?php echo esc_attr($unique_id); ?>" 46 data-swiper-initialized="false"> 47 48 <div class="swiper-wrapper"> 49 <?php foreach ($cards as $index => $card) : ?> 50 <div class="swiper-slide" 51 style="display:flex;justify-content:center;align-items:center;"> 52 <?php echo wp_kses_post(slidecrafterreborn_unescape_html($card)); ?> 53 </div> 50 <div class="swiper slidecrafterreborn-slider slidecrafterreborn-slider-<?php echo esc_attr($post_id); ?>" id="<?php echo esc_attr($unique_id); ?>" data-swiper-initialized="false"> 51 <div class="swiper-wrapper" style="display:flex;" id="swiper-wrapper-<?php echo esc_attr(wp_generate_uuid4()); ?>" aria-live="off"> 52 <?php foreach ($cards as $index => $card): ?> 53 <div class="swiper-slide" style="display:flex;justify-content:center;" role="group" aria-label="<?php echo esc_attr(($index + 1) . ' / ' . count($cards)); ?>" data-swiper-slide-index="<?php echo esc_attr($index); ?>"><?php echo wp_kses_post($card); ?></div> 54 54 <?php endforeach; ?> 55 55 </div> 56 57 <?php if (!empty($settings['pagination'])) : ?> 58 <div class="swiper-pagination slidecrafterreborn-pagination active-bullet-gold"></div> 59 <?php endif; ?> 60 61 <?php if (!empty($settings['navigation'])) : ?> 62 <div class="swiper-button-prev"></div> 63 <div class="swiper-button-next"></div> 64 <?php endif; ?> 56 <div class="swiper-pagination slidecrafterreborn-pagination active-bullet-gold" style="display:<?php echo esc_attr(($settings['pagination'] ?? true) ? 'block' : 'none'); ?>;margin-top:10px;"></div> 57 <div class="swiper-button-prev" style="display:<?php echo esc_attr(($settings['navigation'] ?? false) ? 'block' : 'none'); ?>;"></div> 58 <div class="swiper-button-next" style="display:<?php echo esc_attr(($settings['navigation'] ?? false) ? 'block' : 'none'); ?>;"></div> 65 59 </div> 66 67 <?php echo $custom_css; ?> 68 60 <?php echo $custom_css_style; ?> 69 61 <style> 70 62 #<?php echo esc_attr($unique_id); ?>.slidecrafterreborn-slider { 71 padding:20px; 72 background:#fafafa; 73 border-radius:8px; 74 box-shadow:0 2px 4px rgba(0,0,0,0.1); 75 overflow:hidden; 63 padding:20px;background:#fafafa;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,0.1); 76 64 } 77 #<?php echo esc_attr($unique_id); ?> .swiper-pagination-bullet-active { background:gold; } 65 #<?php echo esc_attr($unique_id); ?> .swiper-pagination-bullet-active { 66 background:gold; 67 } 68 #<?php echo esc_attr($unique_id); ?> .swiper-slide { 69 width:405px;text-align:center;display:flex;justify-content:center;align-items:center; 70 } 71 #<?php echo esc_attr($unique_id); ?> .swiper-wrapper { 72 display:flex; 73 } 78 74 #<?php echo esc_attr($unique_id); ?> .swiper-button-prev, 79 75 #<?php echo esc_attr($unique_id); ?> .swiper-button-next { 80 color:gold; 81 background:rgba(0,0,0,0.5); 82 border-radius:50%; 83 width:40px; 84 height:40px; 76 color:gold;background:rgba(0,0,0,0.5);border-radius:50%;width:40px;height:40px;opacity:1;transition:opacity 0.3s;z-index:10; 77 } 78 #<?php echo esc_attr($unique_id); ?> .swiper-button-prev:hover, 79 #<?php echo esc_attr($unique_id); ?> .swiper-button-next:hover { 80 opacity:0.8; 81 } 82 @media (max-width:768px) { 83 #<?php echo esc_attr($unique_id); ?> .swiper-slide { 84 width:300px; 85 } 85 86 } 86 87 </style> 87 88 <!-- LE SCRIPT MANQUANT — C’EST LUI QUI FAIT TOUT DÉFILER -->89 88 <script> 90 document.addEventListener('DOMContentLoaded', function () { 91 const container = document.getElementById('<?php echo esc_js($unique_id); ?>'); 92 if (!container || container.getAttribute('data-swiper-initialized') === 'true') return; 93 94 container.setAttribute('data-swiper-initialized', 'true'); 95 96 if (typeof Swiper === 'undefined') { 97 console.error('Swiper non chargé'); 98 return; 99 } 100 101 new Swiper('#<?php echo esc_js($unique_id); ?>', { 102 slidesPerView: <?php echo esc_js($slides_per_view); ?>, 103 spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?>, 104 loop: <?php echo (!empty($settings['loop'])) ? 'true' : 'false'; ?>, 105 autoplay: <?php echo (!empty($settings['autoplay'])) ? '{ delay: ' . esc_js($settings['transition_speed'] ?? 3000) . ' }' : 'false'; ?>, 106 pagination: <?php echo (!empty($settings['pagination'])) ? "{ el: '#" . esc_js($unique_id) . " .swiper-pagination', clickable: true }" : 'false'; ?>, 107 navigation: <?php echo (!empty($settings['navigation'])) ? "{ nextEl: '#" . esc_js($unique_id) . " .swiper-button-next', prevEl: '#" . esc_js($unique_id) . " .swiper-button-prev' }" : 'false'; ?>, 108 effect: '<?php echo esc_js($settings['animation_type'] ?? 'slide'); ?>', 109 breakpoints: { 110 480: { slidesPerView: 1, spaceBetween: 10 }, 111 768: { slidesPerView: 2, spaceBetween: 15 }, 112 1024: { slidesPerView: <?php echo esc_js($slides_per_view); ?>, spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?> } 89 document.addEventListener('DOMContentLoaded', function() { 90 function initSwiper() { 91 var swiperContainer = document.getElementById('<?php echo esc_js($unique_id); ?>'); 92 if (swiperContainer && swiperContainer.getAttribute('data-swiper-initialized') === 'false') { 93 swiperContainer.setAttribute('data-swiper-initialized', 'true'); 94 } 95 if (typeof Swiper === 'undefined') { 96 console.error('Swiper is not loaded for frontend, retrying...'); 97 setTimeout(initSwiper, 100); 98 return; 99 } 100 new Swiper('#<?php echo esc_js($unique_id); ?>', { 101 slidesPerView: <?php echo esc_js($slides_per_view); ?>, 102 slidesPerGroup: 1, 103 spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?>, 104 loop: <?php echo ($settings['loop'] ?? true) ? 'true' : 'false'; ?>, 105 loopAdditionalSlides: 1, 106 initialSlide: 0, 107 watchOverflow: true, 108 watchSlidesProgress: true, 109 preventClicks: false, 110 updateOnWindowResize: true, 111 observer: true, 112 observeParents: true, 113 effect: '<?php echo esc_js($settings['animation_type'] ?? 'slide'); ?>', 114 pagination: <?php echo ($settings['pagination'] ?? true) ? "{ el: '#" . esc_js($unique_id) . " .slidecrafterreborn-pagination', clickable: true }" : 'false'; ?>, 115 navigation: <?php echo ($settings['navigation'] ?? false) ? "{ nextEl: '#" . esc_js($unique_id) . " .swiper-button-next', prevEl: '#" . esc_js($unique_id) . " .swiper-button-prev' }" : 'false'; ?>, 116 autoplay: <?php echo ($settings['autoplay'] ?? true) ? "{ delay: " . esc_js($settings['transition_speed'] ?? 3000) . ", disableOnInteraction: false, pauseOnMouseEnter: false }" : 'false'; ?>, 117 cubeEffect: { shadow: false, slideShadows: false }, 118 fadeEffect: { crossFade: true }, 119 breakpoints: { 120 480: { slidesPerView: 1, spaceBetween: 10 }, 121 768: { slidesPerView: 2, spaceBetween: 15 }, 122 1024: { slidesPerView: <?php echo esc_js($slides_per_view); ?>, spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?> } 123 } 124 }); 113 125 } 126 initSwiper(); 114 127 }); 115 });116 128 </script> 117 129 <?php -
slide-crafter-reborn/tags/1.1.1/readme.txt
r3413240 r3413265 5 5 Requires at least: 5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 33 33 34 34 == Changelog == 35 = 1.1.1 = 36 * Fixed a regression in shortcode result display. 37 35 38 = 1.1.0 = 36 39 * Improved code display. -
slide-crafter-reborn/tags/1.1.1/slide-crafter-reborn.php
r3413240 r3413265 4 4 * Plugin URI: https://github.com/tlloancy/slide-crafter-reborn 5 5 * Description: Create responsive slider carousels with dynamic cards, real-time preview, and shortcode output. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: Thomas Lloancy 8 8 * Author URI: https://github.com/tlloancy -
slide-crafter-reborn/trunk/includes/shortcodes.php
r3413240 r3413265 5 5 $atts = shortcode_atts(['id' => ''], $atts, 'slidecrafterreborn_slide'); 6 6 $post_id = absint($atts['id']); 7 8 7 if (!$post_id || get_post_type($post_id) !== 'slcr_reborn_slide') { 8 error_log('Slide Crafter Reborn: Invalid or missing slide ID: ' . $post_id); 9 9 return '<p>' . esc_html__('Invalid or missing slide ID.', 'slide-crafter-reborn') . '</p>'; 10 10 } 11 11 12 12 $slide_data = get_option('slidecrafterreborn_slide_' . $post_id); 13 if (!$slide_data) return '<p>' . esc_html__('Slide not found.', 'slide-crafter-reborn') . '</p>'; 13 if (!$slide_data) { 14 error_log('Slide Crafter Reborn: Slide not found for ID: ' . $post_id); 15 return '<p>' . esc_html__('Slide not found.', 'slide-crafter-reborn') . '</p>'; 16 } 14 17 15 18 $slide = json_decode($slide_data, true); 16 if (!$slide || empty($slide['cards'])) return '<p>' . esc_html__('No cards defined for this slide.', 'slide-crafter-reborn') . '</p>'; 19 if (!$slide || !isset($slide['cards']) || empty($slide['cards'])) { 20 error_log('Slide Crafter Reborn: No cards defined for slide ID ' . $post_id); 21 return '<p>' . esc_html__('No cards defined for this slide.', 'slide-crafter-reborn') . '</p>'; 22 } 17 23 18 24 $settings = $slide['settings'] ?? []; 19 $cards = $slide['cards'];20 21 $slides_per_view = ($settings['animation_type'] ?? 'slide') === 'cube' ? 1 : ($settings['slides_per_view'] ?? 3);22 if (count($cards) < $slides_per_view)$slides_per_view = count($cards);23 25 $cards = $slide['cards']; 26 $slides_per_view = $settings['animation_type'] === 'cube' ? 1 : ($settings['slides_per_view'] ?? 3); 27 if (count($cards) < $slides_per_view) { 28 $slides_per_view = count($cards); 29 } 24 30 $unique_id = 'swiper-' . wp_generate_uuid4(); 25 31 26 32 wp_enqueue_style('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../css/swiper-bundle.css', [], '8.4.7'); 27 wp_enqueue_script('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../js/swiper-bundle.js', [], '8.4. ConcurrentLinkedDeque4.7', true);33 wp_enqueue_script('slidecrafterreborn-swiper', plugin_dir_url(__FILE__) . '../js/swiper-bundle.js', [], '8.4.7', true); 28 34 29 // CORRECTION CSS : appliqué au conteneur30 $custom_css = '';31 35 if (!empty($settings['custom_css'])) { 32 $ css = str_replace(33 ['body ', 'html ', 'body>', 'html>'],34 ['#' . $unique_id . ' ', '#' . $unique_id . ' ', '#' . $unique_id . '>', '#' . $unique_id . '>'],35 $settings['custom_css']36 );37 $css = preg_replace('/^\s*body\s*\{.*?\}\s*/is', '', $css);38 $sanitized = slidecrafterreborn_sanitize_css($css);39 if ($sanitized) $custom_css = "<style>#{$unique_id} { {$sanitized} }</style>";36 $sanitized_css = slidecrafterreborn_sanitize_css($settings['custom_css']); 37 if (!empty($sanitized_css)) { 38 $custom_css_style = "<style>#$unique_id .swiper-slide { $sanitized_css }</style>"; 39 } else { 40 $custom_css_style = ''; 41 } 42 } else { 43 $custom_css_style = ''; 40 44 } 45 46 error_log('Slide Crafter Reborn: Rendering slide ID ' . $post_id . ', cards count: ' . count($cards) . ', settings: ' . json_encode($settings)); 41 47 42 48 ob_start(); 43 49 ?> 44 <div class="swiper slidecrafterreborn-slider slidecrafterreborn-slider-<?php echo esc_attr($post_id); ?>" 45 id="<?php echo esc_attr($unique_id); ?>" 46 data-swiper-initialized="false"> 47 48 <div class="swiper-wrapper"> 49 <?php foreach ($cards as $index => $card) : ?> 50 <div class="swiper-slide" 51 style="display:flex;justify-content:center;align-items:center;"> 52 <?php echo wp_kses_post(slidecrafterreborn_unescape_html($card)); ?> 53 </div> 50 <div class="swiper slidecrafterreborn-slider slidecrafterreborn-slider-<?php echo esc_attr($post_id); ?>" id="<?php echo esc_attr($unique_id); ?>" data-swiper-initialized="false"> 51 <div class="swiper-wrapper" style="display:flex;" id="swiper-wrapper-<?php echo esc_attr(wp_generate_uuid4()); ?>" aria-live="off"> 52 <?php foreach ($cards as $index => $card): ?> 53 <div class="swiper-slide" style="display:flex;justify-content:center;" role="group" aria-label="<?php echo esc_attr(($index + 1) . ' / ' . count($cards)); ?>" data-swiper-slide-index="<?php echo esc_attr($index); ?>"><?php echo wp_kses_post($card); ?></div> 54 54 <?php endforeach; ?> 55 55 </div> 56 57 <?php if (!empty($settings['pagination'])) : ?> 58 <div class="swiper-pagination slidecrafterreborn-pagination active-bullet-gold"></div> 59 <?php endif; ?> 60 61 <?php if (!empty($settings['navigation'])) : ?> 62 <div class="swiper-button-prev"></div> 63 <div class="swiper-button-next"></div> 64 <?php endif; ?> 56 <div class="swiper-pagination slidecrafterreborn-pagination active-bullet-gold" style="display:<?php echo esc_attr(($settings['pagination'] ?? true) ? 'block' : 'none'); ?>;margin-top:10px;"></div> 57 <div class="swiper-button-prev" style="display:<?php echo esc_attr(($settings['navigation'] ?? false) ? 'block' : 'none'); ?>;"></div> 58 <div class="swiper-button-next" style="display:<?php echo esc_attr(($settings['navigation'] ?? false) ? 'block' : 'none'); ?>;"></div> 65 59 </div> 66 67 <?php echo $custom_css; ?> 68 60 <?php echo $custom_css_style; ?> 69 61 <style> 70 62 #<?php echo esc_attr($unique_id); ?>.slidecrafterreborn-slider { 71 padding:20px; 72 background:#fafafa; 73 border-radius:8px; 74 box-shadow:0 2px 4px rgba(0,0,0,0.1); 75 overflow:hidden; 63 padding:20px;background:#fafafa;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,0.1); 76 64 } 77 #<?php echo esc_attr($unique_id); ?> .swiper-pagination-bullet-active { background:gold; } 65 #<?php echo esc_attr($unique_id); ?> .swiper-pagination-bullet-active { 66 background:gold; 67 } 68 #<?php echo esc_attr($unique_id); ?> .swiper-slide { 69 width:405px;text-align:center;display:flex;justify-content:center;align-items:center; 70 } 71 #<?php echo esc_attr($unique_id); ?> .swiper-wrapper { 72 display:flex; 73 } 78 74 #<?php echo esc_attr($unique_id); ?> .swiper-button-prev, 79 75 #<?php echo esc_attr($unique_id); ?> .swiper-button-next { 80 color:gold; 81 background:rgba(0,0,0,0.5); 82 border-radius:50%; 83 width:40px; 84 height:40px; 76 color:gold;background:rgba(0,0,0,0.5);border-radius:50%;width:40px;height:40px;opacity:1;transition:opacity 0.3s;z-index:10; 77 } 78 #<?php echo esc_attr($unique_id); ?> .swiper-button-prev:hover, 79 #<?php echo esc_attr($unique_id); ?> .swiper-button-next:hover { 80 opacity:0.8; 81 } 82 @media (max-width:768px) { 83 #<?php echo esc_attr($unique_id); ?> .swiper-slide { 84 width:300px; 85 } 85 86 } 86 87 </style> 87 88 <!-- LE SCRIPT MANQUANT — C’EST LUI QUI FAIT TOUT DÉFILER -->89 88 <script> 90 document.addEventListener('DOMContentLoaded', function () { 91 const container = document.getElementById('<?php echo esc_js($unique_id); ?>'); 92 if (!container || container.getAttribute('data-swiper-initialized') === 'true') return; 93 94 container.setAttribute('data-swiper-initialized', 'true'); 95 96 if (typeof Swiper === 'undefined') { 97 console.error('Swiper non chargé'); 98 return; 99 } 100 101 new Swiper('#<?php echo esc_js($unique_id); ?>', { 102 slidesPerView: <?php echo esc_js($slides_per_view); ?>, 103 spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?>, 104 loop: <?php echo (!empty($settings['loop'])) ? 'true' : 'false'; ?>, 105 autoplay: <?php echo (!empty($settings['autoplay'])) ? '{ delay: ' . esc_js($settings['transition_speed'] ?? 3000) . ' }' : 'false'; ?>, 106 pagination: <?php echo (!empty($settings['pagination'])) ? "{ el: '#" . esc_js($unique_id) . " .swiper-pagination', clickable: true }" : 'false'; ?>, 107 navigation: <?php echo (!empty($settings['navigation'])) ? "{ nextEl: '#" . esc_js($unique_id) . " .swiper-button-next', prevEl: '#" . esc_js($unique_id) . " .swiper-button-prev' }" : 'false'; ?>, 108 effect: '<?php echo esc_js($settings['animation_type'] ?? 'slide'); ?>', 109 breakpoints: { 110 480: { slidesPerView: 1, spaceBetween: 10 }, 111 768: { slidesPerView: 2, spaceBetween: 15 }, 112 1024: { slidesPerView: <?php echo esc_js($slides_per_view); ?>, spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?> } 89 document.addEventListener('DOMContentLoaded', function() { 90 function initSwiper() { 91 var swiperContainer = document.getElementById('<?php echo esc_js($unique_id); ?>'); 92 if (swiperContainer && swiperContainer.getAttribute('data-swiper-initialized') === 'false') { 93 swiperContainer.setAttribute('data-swiper-initialized', 'true'); 94 } 95 if (typeof Swiper === 'undefined') { 96 console.error('Swiper is not loaded for frontend, retrying...'); 97 setTimeout(initSwiper, 100); 98 return; 99 } 100 new Swiper('#<?php echo esc_js($unique_id); ?>', { 101 slidesPerView: <?php echo esc_js($slides_per_view); ?>, 102 slidesPerGroup: 1, 103 spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?>, 104 loop: <?php echo ($settings['loop'] ?? true) ? 'true' : 'false'; ?>, 105 loopAdditionalSlides: 1, 106 initialSlide: 0, 107 watchOverflow: true, 108 watchSlidesProgress: true, 109 preventClicks: false, 110 updateOnWindowResize: true, 111 observer: true, 112 observeParents: true, 113 effect: '<?php echo esc_js($settings['animation_type'] ?? 'slide'); ?>', 114 pagination: <?php echo ($settings['pagination'] ?? true) ? "{ el: '#" . esc_js($unique_id) . " .slidecrafterreborn-pagination', clickable: true }" : 'false'; ?>, 115 navigation: <?php echo ($settings['navigation'] ?? false) ? "{ nextEl: '#" . esc_js($unique_id) . " .swiper-button-next', prevEl: '#" . esc_js($unique_id) . " .swiper-button-prev' }" : 'false'; ?>, 116 autoplay: <?php echo ($settings['autoplay'] ?? true) ? "{ delay: " . esc_js($settings['transition_speed'] ?? 3000) . ", disableOnInteraction: false, pauseOnMouseEnter: false }" : 'false'; ?>, 117 cubeEffect: { shadow: false, slideShadows: false }, 118 fadeEffect: { crossFade: true }, 119 breakpoints: { 120 480: { slidesPerView: 1, spaceBetween: 10 }, 121 768: { slidesPerView: 2, spaceBetween: 15 }, 122 1024: { slidesPerView: <?php echo esc_js($slides_per_view); ?>, spaceBetween: <?php echo esc_js($settings['space_between'] ?? 20); ?> } 123 } 124 }); 113 125 } 126 initSwiper(); 114 127 }); 115 });116 128 </script> 117 129 <?php -
slide-crafter-reborn/trunk/readme.txt
r3413240 r3413265 5 5 Requires at least: 5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.1. 07 Stable tag: 1.1.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 33 33 34 34 == Changelog == 35 = 1.1.1 = 36 * Fixed a regression in shortcode result display. 37 35 38 = 1.1.0 = 36 39 * Improved code display. -
slide-crafter-reborn/trunk/slide-crafter-reborn.php
r3413240 r3413265 4 4 * Plugin URI: https://github.com/tlloancy/slide-crafter-reborn 5 5 * Description: Create responsive slider carousels with dynamic cards, real-time preview, and shortcode output. 6 * Version: 1.1. 06 * Version: 1.1.1 7 7 * Author: Thomas Lloancy 8 8 * Author URI: https://github.com/tlloancy
Note: See TracChangeset
for help on using the changeset viewer.