Plugin Directory

Changeset 3282723


Ignore:
Timestamp:
04/27/2025 01:08:13 PM (9 months ago)
Author:
virgildia
Message:

Update to v 2.0.1

Location:
carousel-block
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • carousel-block/tags/2.0.0/admin/class-block-filters.php

    r3282662 r3282723  
    22
    33namespace CarouselSliderBlock\Admin;
    4 
    5 use WP_Block_Type_Registry;
    64
    75class Block_Filters {
     
    119     */
    1210    public static function init() {
    13         add_filter( 'allowed_block_types_all', [ self::class, 'filter_legacy_blocks' ], 10, 2 );
     11        add_filter( 'block_type_metadata_settings', [ self::class, 'filter_legacy_blocks_inserter' ], 10, 2 );
    1412    }
    1513
    1614    /**
    17      * Disallow legacy blocks when setting is enabled.
     15     * Hide legacy blocks from inserter but keep them available.
    1816     *
    19      * @param array|bool $allowed_block_types
    20      * @param \WP_Block_Editor_Context $editor_context
    21      * @return array|bool
     17     * @param array $settings Block settings.
     18     * @param array $metadata Block metadata.
     19     * @return array Modified block settings.
    2220     */
    23     public static function filter_legacy_blocks( $allowed_block_types, $editor_context ) {
    24         // Bail early if not hiding legacy blocks.     
    25         if ( ! Settings_Utils::get_setting( 'hide_legacy_carousel', false ) ) {
    26            return $allowed_block_types;
     21    public static function filter_legacy_blocks_inserter( $settings, $metadata ) {
     22        // Bail if show legacy blocks is enabled.
     23        if ( Settings_Utils::get_setting( 'show_legacy_blocks', false ) ) {
     24            return $settings;
    2725        }
    2826
    29         // Only apply in post editor.
    30         if ( isset( $editor_context->name ) && $editor_context->name !== 'core/edit-post' ) {
    31           return $allowed_block_types;
     27        // Target only the legacy blocks.
     28        if ( in_array( $metadata['name'], [ 'cb/carousel' ], true ) ) {
     29            $settings['supports']['inserter'] = false;
    3230        }
    3331
    34         // Define blocks to hide.
    35         $disallowed_blocks = [
    36             'cb/carousel',
    37             'cb/slide',
    38         ];
    39 
    40         // If $allowed_block_types is true or not an array, get all registered blocks.
    41         if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) {
    42             $registered = WP_Block_Type_Registry::get_instance()->get_all_registered();
    43             $allowed_block_types = array_keys( $registered );
    44         }
    45 
    46         // Filter out disallowed blocks.
    47         $filtered_blocks = [];
    48 
    49         foreach ( $allowed_block_types as $block ) {
    50             if ( ! in_array( $block, $disallowed_blocks, true ) ) {
    51                 $filtered_blocks[] = $block;
    52             }
    53         }
    54 
    55         return $filtered_blocks;
     32        return $settings;
    5633    }
    5734}
  • carousel-block/tags/2.0.0/admin/class-settings-page.php

    r3282662 r3282723  
    4444    public static function initialize_settings() {
    4545        \register_setting( 'cbCarouselPage', 'cb_carousel_settings', [ self::class, 'sanitize' ] );
    46 
     46   
    4747        \add_settings_section(
    4848            'cb_carousel_settings_section',
     
    5353
    5454        $options = \get_option( 'cb_carousel_settings' );
    55         self::add_settings_field( 'hide_legacy_carousel', \__( 'Hide Old Carousel Blocks', 'cb' ), $options );
     55        self::add_settings_field( 'show_legacy_blocks', \__( 'Show Old Carousel Blocks', 'cb' ), $options );
    5656        self::add_settings_field( 'hide_legacy_notice', __( 'Hide Legacy Warning Notice', 'cb' ), $options );
    5757    }
     
    6565    public static function sanitize( $input ) {
    6666        $sanitized_input = [];
    67         if ( isset( $input['hide_legacy_carousel'] ) ) {
    68             $sanitized_input['hide_legacy_carousel'] = \filter_var( $input['hide_legacy_carousel'], \FILTER_VALIDATE_BOOLEAN );
    69         }
    70         if ( isset( $input['hide_legacy_notice'] ) ) {
    71             $sanitized_input['hide_legacy_notice'] = filter_var( $input['hide_legacy_notice'], FILTER_VALIDATE_BOOLEAN );
    72         }
     67
     68        $sanitized_input['show_legacy_blocks'] = isset( $input['show_legacy_blocks'] )
     69            ? \filter_var( $input['show_legacy_blocks'], \FILTER_VALIDATE_BOOLEAN )
     70            : false;
     71
     72        $sanitized_input['hide_legacy_notice'] = isset( $input['hide_legacy_notice'] )
     73            ? \filter_var( $input['hide_legacy_notice'], \FILTER_VALIDATE_BOOLEAN )
     74            : false;
     75
    7376        return $sanitized_input;
    7477    }
     
    103106        $options = $args['options'];
    104107        $setting_id = $args['id'];
    105    
     108
    106109        // Get original saved value
    107110        $saved_value = isset( $options[ $setting_id ] ) ? $options[ $setting_id ] : false;
    108    
     111
    109112        // Build filter name
    110113        $filter_name = 'cb_carousel_block_setting_' . $setting_id;
    111    
     114
    112115        // Get filtered value
    113116        $filtered_value = apply_filters( $filter_name, $saved_value, $setting_id );
    114    
     117
    115118        // Detect if a filter is attached
    116119        $forced_by_filter = has_filter( $filter_name );
    117    
     120
    118121        // Use filtered value for checkbox
    119122        $value = $filtered_value ? 1 : 0;
    120    
     123
    121124        echo '<fieldset>';
    122125        echo '<legend class="screen-reader-text"><span>' . esc_html( $args['id'] ) . '</span></legend>';
     
    124127        echo '<input type="checkbox" id="' . esc_attr( $setting_id ) . '" name="cb_carousel_settings[' . esc_attr( $setting_id ) . ']" value="1"' . checked( 1, $value, false ) . '>';
    125128       
    126         if ( $setting_id === 'hide_legacy_carousel' ) {
    127             echo __( 'Hide legacy (non-Swiper) Carousel Slider blocks from the editor inserter.', 'cb' );
     129        if ( $setting_id === 'show_legacy_blocks' ) {
     130            echo __( 'Show legacy (non-Swiper) Carousel Slider blocks in the editor inserter.', 'cb' );
    128131        }
    129    
     132
    130133        if ( $setting_id === 'hide_legacy_notice' ) {
    131134            echo __( 'Hide the notice about legacy Carousel Slider blocks in the editor.', 'cb' );
    132135        }
    133    
     136
    134137        echo '</label>';
    135    
     138
    136139        if ( $forced_by_filter ) {
    137140            echo '<p style="margin: 4px 0 0; font-style: italic; color: #888;">' . __( 'This setting is overridden by a filter.', 'cb' ) . '</p>';
    138141        }
    139    
     142
    140143        echo '</fieldset>';
    141     }   
     144    }
    142145
    143146    /**
     
    151154                <p>Legacy blocks will continue to work, but are no longer recommended.</p>
    152155                <ul style="list-style: disc; padding-left: 20px;">
    153                 <li>To insert new carousels, use the <strong>Carousel Slider v2</strong> block.</li>
    154                 <li>To upgrade a legacy block, select it in the editor, then click the block icon (the first button in the toolbar) and choose <strong>"Transform to Carousel Slider v2."</strong></li>
    155                 <li><strong>Note:</strong> When transforming a legacy block to Carousel Slider v2, the carousel settings will remain unchanged, but the design and markup will be updated.</li>
     156                    <li>To insert new carousels, use the <strong>Carousel Slider v2</strong> block.</li>
     157                    <li>To upgrade a legacy block, select it in the editor, then click the block icon (the first button in the toolbar) and choose <strong>"Transform to Carousel Slider v2."</strong></li>
     158                    <li><strong>Note:</strong> When transforming a legacy block to Carousel Slider v2, the carousel settings will remain unchanged, but the design and markup will be updated.</li>
    156159                </ul>
    157                 <p>You can optionally hide legacy blocks below.</p>
     160                <p>You can optionally re-enable legacy blocks below.</p>
    158161            </div>
    159162
  • carousel-block/tags/2.0.0/build/carousel/style-index-rtl.css

    r3282662 r3282723  
    1 .wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2 .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));left:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{right:auto;left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{right:var(--wp--custom--carousel-block--navigation-sides-offset,10px);left:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{right:auto;left:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-right:auto!important;margin-left:auto!important}
     1.wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2[data-cb-pagination=true] .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));left:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{right:auto;left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{right:var(--wp--custom--carousel-block--navigation-sides-offset,10px);left:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{right:auto;left:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-right:auto!important;margin-left:auto!important}
  • carousel-block/tags/2.0.0/build/carousel/style-index.css

    r3282662 r3282723  
    1 .wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2 .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));right:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{left:auto;right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{left:var(--wp--custom--carousel-block--navigation-sides-offset,10px);right:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{left:auto;right:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-left:auto!important;margin-right:auto!important}
     1.wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2[data-cb-pagination=true] .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));right:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{left:auto;right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{left:var(--wp--custom--carousel-block--navigation-sides-offset,10px);right:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{left:auto;right:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-left:auto!important;margin-right:auto!important}
  • carousel-block/tags/2.0.0/build/components/legacy-warning.asset.php

    r3282700 r3282723  
    1 <?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => 'fac5109873cabc5547b1');
     1<?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => 'ea1898b94bed7f188d01');
  • carousel-block/tags/2.0.0/build/components/legacy-warning.js

    r3282700 r3282723  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.i18n,c="cb-legacy-carousel-warning";let i=!1,s=null;(0,e.subscribe)((()=>{const o=(0,e.select)("core/block-editor").getBlocks().some((e=>"cb/carousel"===e.name));o!==s&&(s=o,!o||i||"undefined"!=typeof cbLegacySettings&&cbLegacySettings.hideLegacyNotice||((0,e.dispatch)("core/notices").createNotice("warning",(0,t.__)("This content uses a legacy Carousel Slider block. Transform it to Version 2 from the block's toolbar (first button). Note: The design and HTML will change; block settings remain.","cb"),{id:c,isDismissible:!0,actions:[{label:(0,t.__)("Open settings to hide legacy blocks","cb"),url:"/wp-admin/options-general.php?page=cb-carousel-settings",variant:"link"}]}),i=!0),!o&&i&&((0,e.dispatch)("core/notices").removeNotice(c),i=!1))}))})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.i18n,i="cb-legacy-carousel-warning";let s=!1,c=null;(0,e.subscribe)((()=>{const o=(0,e.select)("core/block-editor").getBlocks().some((e=>"cb/carousel"===e.name));o!==c&&(c=o,!o||s||"undefined"!=typeof cbLegacySettings&&cbLegacySettings.hideLegacyNotice||((0,e.dispatch)("core/notices").createNotice("warning",(0,t.__)("You're using a legacy Carousel Slider block. Transform it to Version 2 from the block's toolbar (first button). Note: The design and HTML will change, but your block settings will stay the same.","cb"),{id:i,isDismissible:!0,actions:[{label:(0,t.__)("Open settings to enable/disable legacy blocks","cb"),url:"/wp-admin/options-general.php?page=cb-carousel-settings",variant:"link"}]}),s=!0),!o&&s&&((0,e.dispatch)("core/notices").removeNotice(i),s=!1))}))})();
  • carousel-block/tags/2.0.0/plugin.php

    r3282662 r3282723  
    66 * Author: Virgiliu Diaconu
    77 * Author URI: http://virgiliudiaconu.com/
    8  * Version: 2.0.0
     8 * Version: 2.0.1
    99 * License: GPL2+
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
     
    2424 * @var string
    2525 */
    26 define( 'CB_VERSION', '2.0.0' );
     26define( 'CB_VERSION', '2.0.1' );
    2727
    2828/**
  • carousel-block/tags/2.0.0/readme.txt

    r3282685 r3282723  
    66Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 2.0.0
     8Stable tag: 2.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6161- Legacy styles will not apply to v2. You may need to adjust custom styles.
    6262
    63 **Optional: Hide Legacy Blocks**
     63**Optional: Re-enable Legacy Blocks**
    6464
    65 You can hide legacy blocks from the block inserter and disable v2 upgrade notices in the editor via **Settings → Carousel Slider** in the admin menu.
     65You can show/hide legacy blocks from the block inserter and disable v2 upgrade notices via **Settings → Carousel Slider** in the admin menu.
    6666
    6767**Note**: Legacy blocks will continue to function, but are no longer supported. It is highly recommended to upgrade to v2 for continued improvements and compatibility.
     
    187187- Legacy blocks are still supported but can be upgraded to v2 via block transforms
    188188- Added settings to hide legacy blocks and legacy upgrade notices
     189
     190= 2.0.1 =
     191- Changed legacy block setting to "Show legacy blocks", disabled by default.
     192- CSS update for pagination margin.
  • carousel-block/trunk/admin/class-block-filters.php

    r3282662 r3282723  
    22
    33namespace CarouselSliderBlock\Admin;
    4 
    5 use WP_Block_Type_Registry;
    64
    75class Block_Filters {
     
    119     */
    1210    public static function init() {
    13         add_filter( 'allowed_block_types_all', [ self::class, 'filter_legacy_blocks' ], 10, 2 );
     11        add_filter( 'block_type_metadata_settings', [ self::class, 'filter_legacy_blocks_inserter' ], 10, 2 );
    1412    }
    1513
    1614    /**
    17      * Disallow legacy blocks when setting is enabled.
     15     * Hide legacy blocks from inserter but keep them available.
    1816     *
    19      * @param array|bool $allowed_block_types
    20      * @param \WP_Block_Editor_Context $editor_context
    21      * @return array|bool
     17     * @param array $settings Block settings.
     18     * @param array $metadata Block metadata.
     19     * @return array Modified block settings.
    2220     */
    23     public static function filter_legacy_blocks( $allowed_block_types, $editor_context ) {
    24         // Bail early if not hiding legacy blocks.     
    25         if ( ! Settings_Utils::get_setting( 'hide_legacy_carousel', false ) ) {
    26            return $allowed_block_types;
     21    public static function filter_legacy_blocks_inserter( $settings, $metadata ) {
     22        // Bail if show legacy blocks is enabled.
     23        if ( Settings_Utils::get_setting( 'show_legacy_blocks', false ) ) {
     24            return $settings;
    2725        }
    2826
    29         // Only apply in post editor.
    30         if ( isset( $editor_context->name ) && $editor_context->name !== 'core/edit-post' ) {
    31           return $allowed_block_types;
     27        // Target only the legacy blocks.
     28        if ( in_array( $metadata['name'], [ 'cb/carousel' ], true ) ) {
     29            $settings['supports']['inserter'] = false;
    3230        }
    3331
    34         // Define blocks to hide.
    35         $disallowed_blocks = [
    36             'cb/carousel',
    37             'cb/slide',
    38         ];
    39 
    40         // If $allowed_block_types is true or not an array, get all registered blocks.
    41         if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) {
    42             $registered = WP_Block_Type_Registry::get_instance()->get_all_registered();
    43             $allowed_block_types = array_keys( $registered );
    44         }
    45 
    46         // Filter out disallowed blocks.
    47         $filtered_blocks = [];
    48 
    49         foreach ( $allowed_block_types as $block ) {
    50             if ( ! in_array( $block, $disallowed_blocks, true ) ) {
    51                 $filtered_blocks[] = $block;
    52             }
    53         }
    54 
    55         return $filtered_blocks;
     32        return $settings;
    5633    }
    5734}
  • carousel-block/trunk/admin/class-settings-page.php

    r3282662 r3282723  
    4444    public static function initialize_settings() {
    4545        \register_setting( 'cbCarouselPage', 'cb_carousel_settings', [ self::class, 'sanitize' ] );
    46 
     46   
    4747        \add_settings_section(
    4848            'cb_carousel_settings_section',
     
    5353
    5454        $options = \get_option( 'cb_carousel_settings' );
    55         self::add_settings_field( 'hide_legacy_carousel', \__( 'Hide Old Carousel Blocks', 'cb' ), $options );
     55        self::add_settings_field( 'show_legacy_blocks', \__( 'Show Old Carousel Blocks', 'cb' ), $options );
    5656        self::add_settings_field( 'hide_legacy_notice', __( 'Hide Legacy Warning Notice', 'cb' ), $options );
    5757    }
     
    6565    public static function sanitize( $input ) {
    6666        $sanitized_input = [];
    67         if ( isset( $input['hide_legacy_carousel'] ) ) {
    68             $sanitized_input['hide_legacy_carousel'] = \filter_var( $input['hide_legacy_carousel'], \FILTER_VALIDATE_BOOLEAN );
    69         }
    70         if ( isset( $input['hide_legacy_notice'] ) ) {
    71             $sanitized_input['hide_legacy_notice'] = filter_var( $input['hide_legacy_notice'], FILTER_VALIDATE_BOOLEAN );
    72         }
     67
     68        $sanitized_input['show_legacy_blocks'] = isset( $input['show_legacy_blocks'] )
     69            ? \filter_var( $input['show_legacy_blocks'], \FILTER_VALIDATE_BOOLEAN )
     70            : false;
     71
     72        $sanitized_input['hide_legacy_notice'] = isset( $input['hide_legacy_notice'] )
     73            ? \filter_var( $input['hide_legacy_notice'], \FILTER_VALIDATE_BOOLEAN )
     74            : false;
     75
    7376        return $sanitized_input;
    7477    }
     
    103106        $options = $args['options'];
    104107        $setting_id = $args['id'];
    105    
     108
    106109        // Get original saved value
    107110        $saved_value = isset( $options[ $setting_id ] ) ? $options[ $setting_id ] : false;
    108    
     111
    109112        // Build filter name
    110113        $filter_name = 'cb_carousel_block_setting_' . $setting_id;
    111    
     114
    112115        // Get filtered value
    113116        $filtered_value = apply_filters( $filter_name, $saved_value, $setting_id );
    114    
     117
    115118        // Detect if a filter is attached
    116119        $forced_by_filter = has_filter( $filter_name );
    117    
     120
    118121        // Use filtered value for checkbox
    119122        $value = $filtered_value ? 1 : 0;
    120    
     123
    121124        echo '<fieldset>';
    122125        echo '<legend class="screen-reader-text"><span>' . esc_html( $args['id'] ) . '</span></legend>';
     
    124127        echo '<input type="checkbox" id="' . esc_attr( $setting_id ) . '" name="cb_carousel_settings[' . esc_attr( $setting_id ) . ']" value="1"' . checked( 1, $value, false ) . '>';
    125128       
    126         if ( $setting_id === 'hide_legacy_carousel' ) {
    127             echo __( 'Hide legacy (non-Swiper) Carousel Slider blocks from the editor inserter.', 'cb' );
     129        if ( $setting_id === 'show_legacy_blocks' ) {
     130            echo __( 'Show legacy (non-Swiper) Carousel Slider blocks in the editor inserter.', 'cb' );
    128131        }
    129    
     132
    130133        if ( $setting_id === 'hide_legacy_notice' ) {
    131134            echo __( 'Hide the notice about legacy Carousel Slider blocks in the editor.', 'cb' );
    132135        }
    133    
     136
    134137        echo '</label>';
    135    
     138
    136139        if ( $forced_by_filter ) {
    137140            echo '<p style="margin: 4px 0 0; font-style: italic; color: #888;">' . __( 'This setting is overridden by a filter.', 'cb' ) . '</p>';
    138141        }
    139    
     142
    140143        echo '</fieldset>';
    141     }   
     144    }
    142145
    143146    /**
     
    151154                <p>Legacy blocks will continue to work, but are no longer recommended.</p>
    152155                <ul style="list-style: disc; padding-left: 20px;">
    153                 <li>To insert new carousels, use the <strong>Carousel Slider v2</strong> block.</li>
    154                 <li>To upgrade a legacy block, select it in the editor, then click the block icon (the first button in the toolbar) and choose <strong>"Transform to Carousel Slider v2."</strong></li>
    155                 <li><strong>Note:</strong> When transforming a legacy block to Carousel Slider v2, the carousel settings will remain unchanged, but the design and markup will be updated.</li>
     156                    <li>To insert new carousels, use the <strong>Carousel Slider v2</strong> block.</li>
     157                    <li>To upgrade a legacy block, select it in the editor, then click the block icon (the first button in the toolbar) and choose <strong>"Transform to Carousel Slider v2."</strong></li>
     158                    <li><strong>Note:</strong> When transforming a legacy block to Carousel Slider v2, the carousel settings will remain unchanged, but the design and markup will be updated.</li>
    156159                </ul>
    157                 <p>You can optionally hide legacy blocks below.</p>
     160                <p>You can optionally re-enable legacy blocks below.</p>
    158161            </div>
    159162
  • carousel-block/trunk/build/carousel/style-index-rtl.css

    r3282662 r3282723  
    1 .wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2 .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));left:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{right:auto;left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{right:var(--wp--custom--carousel-block--navigation-sides-offset,10px);left:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{right:auto;left:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-right:auto!important;margin-left:auto!important}
     1.wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2[data-cb-pagination=true] .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));left:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{right:auto;left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{right:var(--wp--custom--carousel-block--navigation-sides-offset,10px);left:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{right:auto;left:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-right:auto!important;margin-left:auto!important}
  • carousel-block/trunk/build/carousel/style-index.css

    r3282662 r3282723  
    1 .wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2 .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));right:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{left:auto;right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{left:var(--wp--custom--carousel-block--navigation-sides-offset,10px);right:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{left:auto;right:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-left:auto!important;margin-right:auto!important}
     1.wp-block-cb-carousel-v2{position:relative}.wp-block-cb-carousel-v2[data-cb-pagination=true] .swiper-horizontal{margin-bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*4)}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2 .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-color,#000);height:var(--wp--custom--carousel-block--navigation-size,22px);margin-top:calc(0px - var(--wp--custom--carousel-block--navigation-size, 22px)/2);width:calc(var(--wp--custom--carousel-block--navigation-size, 22px)/44*27)}.wp-block-cb-carousel-v2 .cb-button-next:after,.wp-block-cb-carousel-v2 .cb-button-prev:after{font-size:var(--wp--custom--carousel-block--navigation-size,22px)}.wp-block-cb-carousel-v2 .cb-button-prev,.wp-block-cb-carousel-v2.cb-rtl .cb-button-next{left:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px));right:auto}.wp-block-cb-carousel-v2 .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{left:auto;right:calc(var(--wp--custom--carousel-block--navigation-size, 22px)*-1/44*27 - var(--wp--custom--carousel-block--navigation-sides-offset, 10px))}.wp-block-cb-carousel-v2.cb-rtl .cb-button-next,.wp-block-cb-carousel-v2.cb-rtl .cb-button-prev{transform:scaleX(-1)}.wp-block-cb-carousel-v2 .cb-pagination.swiper-pagination-horizontal{bottom:calc(var(--wp--custom--carousel-block--pagination-bullet-size, 8px)*-2.5);display:flex;justify-content:center;top:var(--wp--custom--carousel-block--pagination-top,auto)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet{background:var(--wp--custom--carousel-block--pagination-bullet-color,#999);height:var(--wp--custom--carousel-block--pagination-bullet-size,8px);opacity:var(--wp--custom--carousel-block--pagination-bullet-opacity,.5);width:var(--wp--custom--carousel-block--pagination-bullet-size,8px)}.wp-block-cb-carousel-v2 .cb-pagination .cb-pagination-bullet.swiper-pagination-bullet-active{background:var(--wp--custom--carousel-block--pagination-bullet-active-color,#000);opacity:var(--wp--custom--carousel-block--pagination-bullet-active-opacity,1)}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull .cb-button-prev{color:var(--wp--custom--carousel-block--navigation-alignfull-color,#000)}.wp-block-cb-carousel-v2.alignfull .cb-button-prev,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-next{left:var(--wp--custom--carousel-block--navigation-sides-offset,10px);right:auto}.wp-block-cb-carousel-v2.alignfull .cb-button-next,.wp-block-cb-carousel-v2.alignfull.cb-rtl .cb-button-prev{left:auto;right:var(--wp--custom--carousel-block--navigation-sides-offset,10px)}.wp-block-cb-carousel-v2 .wp-block-image{margin-bottom:var(--wp--custom--carousel-block--image-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--image-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover{margin-bottom:var(--wp--custom--carousel-block--cover-margin-bottom,0);margin-top:var(--wp--custom--carousel-block--cover-margin-top,0)}.wp-block-cb-carousel-v2 .wp-block-cover.aligncenter,.wp-block-cb-carousel-v2 .wp-block-image.aligncenter{margin-left:auto!important;margin-right:auto!important}
  • carousel-block/trunk/build/components/legacy-warning.asset.php

    r3282700 r3282723  
    1 <?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => 'fac5109873cabc5547b1');
     1<?php return array('dependencies' => array('wp-data', 'wp-i18n'), 'version' => 'ea1898b94bed7f188d01');
  • carousel-block/trunk/build/components/legacy-warning.js

    r3282700 r3282723  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.i18n,c="cb-legacy-carousel-warning";let i=!1,s=null;(0,e.subscribe)((()=>{const o=(0,e.select)("core/block-editor").getBlocks().some((e=>"cb/carousel"===e.name));o!==s&&(s=o,!o||i||"undefined"!=typeof cbLegacySettings&&cbLegacySettings.hideLegacyNotice||((0,e.dispatch)("core/notices").createNotice("warning",(0,t.__)("This content uses a legacy Carousel Slider block. Transform it to Version 2 from the block's toolbar (first button). Note: The design and HTML will change; block settings remain.","cb"),{id:c,isDismissible:!0,actions:[{label:(0,t.__)("Open settings to hide legacy blocks","cb"),url:"/wp-admin/options-general.php?page=cb-carousel-settings",variant:"link"}]}),i=!0),!o&&i&&((0,e.dispatch)("core/notices").removeNotice(c),i=!1))}))})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.i18n,i="cb-legacy-carousel-warning";let s=!1,c=null;(0,e.subscribe)((()=>{const o=(0,e.select)("core/block-editor").getBlocks().some((e=>"cb/carousel"===e.name));o!==c&&(c=o,!o||s||"undefined"!=typeof cbLegacySettings&&cbLegacySettings.hideLegacyNotice||((0,e.dispatch)("core/notices").createNotice("warning",(0,t.__)("You're using a legacy Carousel Slider block. Transform it to Version 2 from the block's toolbar (first button). Note: The design and HTML will change, but your block settings will stay the same.","cb"),{id:i,isDismissible:!0,actions:[{label:(0,t.__)("Open settings to enable/disable legacy blocks","cb"),url:"/wp-admin/options-general.php?page=cb-carousel-settings",variant:"link"}]}),s=!0),!o&&s&&((0,e.dispatch)("core/notices").removeNotice(i),s=!1))}))})();
  • carousel-block/trunk/plugin.php

    r3282662 r3282723  
    66 * Author: Virgiliu Diaconu
    77 * Author URI: http://virgiliudiaconu.com/
    8  * Version: 2.0.0
     8 * Version: 2.0.1
    99 * License: GPL2+
    1010 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
     
    2424 * @var string
    2525 */
    26 define( 'CB_VERSION', '2.0.0' );
     26define( 'CB_VERSION', '2.0.1' );
    2727
    2828/**
  • carousel-block/trunk/readme.txt

    r3282685 r3282723  
    66Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 2.0.0
     8Stable tag: 2.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6161- Legacy styles will not apply to v2. You may need to adjust custom styles.
    6262
    63 **Optional: Hide Legacy Blocks**
     63**Optional: Re-enable Legacy Blocks**
    6464
    65 You can hide legacy blocks from the block inserter and disable v2 upgrade notices in the editor via **Settings → Carousel Slider** in the admin menu.
     65You can show/hide legacy blocks from the block inserter and disable v2 upgrade notices via **Settings → Carousel Slider** in the admin menu.
    6666
    6767**Note**: Legacy blocks will continue to function, but are no longer supported. It is highly recommended to upgrade to v2 for continued improvements and compatibility.
     
    187187- Legacy blocks are still supported but can be upgraded to v2 via block transforms
    188188- Added settings to hide legacy blocks and legacy upgrade notices
     189
     190= 2.0.1 =
     191- Changed legacy block setting to "Show legacy blocks", disabled by default.
     192- CSS update for pagination margin.
Note: See TracChangeset for help on using the changeset viewer.