Changeset 3282723
- Timestamp:
- 04/27/2025 01:08:13 PM (9 months ago)
- Location:
- carousel-block
- Files:
-
- 16 edited
-
tags/2.0.0/admin/class-block-filters.php (modified) (2 diffs)
-
tags/2.0.0/admin/class-settings-page.php (modified) (6 diffs)
-
tags/2.0.0/build/carousel/style-index-rtl.css (modified) (1 diff)
-
tags/2.0.0/build/carousel/style-index.css (modified) (1 diff)
-
tags/2.0.0/build/components/legacy-warning.asset.php (modified) (1 diff)
-
tags/2.0.0/build/components/legacy-warning.js (modified) (1 diff)
-
tags/2.0.0/plugin.php (modified) (2 diffs)
-
tags/2.0.0/readme.txt (modified) (3 diffs)
-
trunk/admin/class-block-filters.php (modified) (2 diffs)
-
trunk/admin/class-settings-page.php (modified) (6 diffs)
-
trunk/build/carousel/style-index-rtl.css (modified) (1 diff)
-
trunk/build/carousel/style-index.css (modified) (1 diff)
-
trunk/build/components/legacy-warning.asset.php (modified) (1 diff)
-
trunk/build/components/legacy-warning.js (modified) (1 diff)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
carousel-block/tags/2.0.0/admin/class-block-filters.php
r3282662 r3282723 2 2 3 3 namespace CarouselSliderBlock\Admin; 4 5 use WP_Block_Type_Registry;6 4 7 5 class Block_Filters { … … 11 9 */ 12 10 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 ); 14 12 } 15 13 16 14 /** 17 * Disallow legacy blocks when setting is enabled.15 * Hide legacy blocks from inserter but keep them available. 18 16 * 19 * @param array |bool $allowed_block_types20 * @param \WP_Block_Editor_Context $editor_context21 * @return array |bool17 * @param array $settings Block settings. 18 * @param array $metadata Block metadata. 19 * @return array Modified block settings. 22 20 */ 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; 27 25 } 28 26 29 // Only apply in post editor.30 if ( i sset( $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; 32 30 } 33 31 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; 56 33 } 57 34 } -
carousel-block/tags/2.0.0/admin/class-settings-page.php
r3282662 r3282723 44 44 public static function initialize_settings() { 45 45 \register_setting( 'cbCarouselPage', 'cb_carousel_settings', [ self::class, 'sanitize' ] ); 46 46 47 47 \add_settings_section( 48 48 'cb_carousel_settings_section', … … 53 53 54 54 $options = \get_option( 'cb_carousel_settings' ); 55 self::add_settings_field( ' hide_legacy_carousel', \__( 'HideOld Carousel Blocks', 'cb' ), $options );55 self::add_settings_field( 'show_legacy_blocks', \__( 'Show Old Carousel Blocks', 'cb' ), $options ); 56 56 self::add_settings_field( 'hide_legacy_notice', __( 'Hide Legacy Warning Notice', 'cb' ), $options ); 57 57 } … … 65 65 public static function sanitize( $input ) { 66 66 $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 73 76 return $sanitized_input; 74 77 } … … 103 106 $options = $args['options']; 104 107 $setting_id = $args['id']; 105 108 106 109 // Get original saved value 107 110 $saved_value = isset( $options[ $setting_id ] ) ? $options[ $setting_id ] : false; 108 111 109 112 // Build filter name 110 113 $filter_name = 'cb_carousel_block_setting_' . $setting_id; 111 114 112 115 // Get filtered value 113 116 $filtered_value = apply_filters( $filter_name, $saved_value, $setting_id ); 114 117 115 118 // Detect if a filter is attached 116 119 $forced_by_filter = has_filter( $filter_name ); 117 120 118 121 // Use filtered value for checkbox 119 122 $value = $filtered_value ? 1 : 0; 120 123 121 124 echo '<fieldset>'; 122 125 echo '<legend class="screen-reader-text"><span>' . esc_html( $args['id'] ) . '</span></legend>'; … … 124 127 echo '<input type="checkbox" id="' . esc_attr( $setting_id ) . '" name="cb_carousel_settings[' . esc_attr( $setting_id ) . ']" value="1"' . checked( 1, $value, false ) . '>'; 125 128 126 if ( $setting_id === ' hide_legacy_carousel' ) {127 echo __( ' Hide legacy (non-Swiper) Carousel Slider blocks fromthe editor inserter.', 'cb' );129 if ( $setting_id === 'show_legacy_blocks' ) { 130 echo __( 'Show legacy (non-Swiper) Carousel Slider blocks in the editor inserter.', 'cb' ); 128 131 } 129 132 130 133 if ( $setting_id === 'hide_legacy_notice' ) { 131 134 echo __( 'Hide the notice about legacy Carousel Slider blocks in the editor.', 'cb' ); 132 135 } 133 136 134 137 echo '</label>'; 135 138 136 139 if ( $forced_by_filter ) { 137 140 echo '<p style="margin: 4px 0 0; font-style: italic; color: #888;">' . __( 'This setting is overridden by a filter.', 'cb' ) . '</p>'; 138 141 } 139 142 140 143 echo '</fieldset>'; 141 } 144 } 142 145 143 146 /** … … 151 154 <p>Legacy blocks will continue to work, but are no longer recommended.</p> 152 155 <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> 156 159 </ul> 157 <p>You can optionally hide legacy blocks below.</p>160 <p>You can optionally re-enable legacy blocks below.</p> 158 161 </div> 159 162 -
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 6 6 * Author: Virgiliu Diaconu 7 7 * Author URI: http://virgiliudiaconu.com/ 8 * Version: 2.0. 08 * Version: 2.0.1 9 9 * License: GPL2+ 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt … … 24 24 * @var string 25 25 */ 26 define( 'CB_VERSION', '2.0. 0' );26 define( 'CB_VERSION', '2.0.1' ); 27 27 28 28 /** -
carousel-block/tags/2.0.0/readme.txt
r3282685 r3282723 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.0 8 Stable tag: 2.0. 08 Stable tag: 2.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 61 61 - Legacy styles will not apply to v2. You may need to adjust custom styles. 62 62 63 **Optional: Hide Legacy Blocks**63 **Optional: Re-enable Legacy Blocks** 64 64 65 You can hide legacy blocks from the block inserter and disable v2 upgrade notices in the editorvia **Settings → Carousel Slider** in the admin menu.65 You can show/hide legacy blocks from the block inserter and disable v2 upgrade notices via **Settings → Carousel Slider** in the admin menu. 66 66 67 67 **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. … … 187 187 - Legacy blocks are still supported but can be upgraded to v2 via block transforms 188 188 - 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 2 2 3 3 namespace CarouselSliderBlock\Admin; 4 5 use WP_Block_Type_Registry;6 4 7 5 class Block_Filters { … … 11 9 */ 12 10 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 ); 14 12 } 15 13 16 14 /** 17 * Disallow legacy blocks when setting is enabled.15 * Hide legacy blocks from inserter but keep them available. 18 16 * 19 * @param array |bool $allowed_block_types20 * @param \WP_Block_Editor_Context $editor_context21 * @return array |bool17 * @param array $settings Block settings. 18 * @param array $metadata Block metadata. 19 * @return array Modified block settings. 22 20 */ 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; 27 25 } 28 26 29 // Only apply in post editor.30 if ( i sset( $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; 32 30 } 33 31 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; 56 33 } 57 34 } -
carousel-block/trunk/admin/class-settings-page.php
r3282662 r3282723 44 44 public static function initialize_settings() { 45 45 \register_setting( 'cbCarouselPage', 'cb_carousel_settings', [ self::class, 'sanitize' ] ); 46 46 47 47 \add_settings_section( 48 48 'cb_carousel_settings_section', … … 53 53 54 54 $options = \get_option( 'cb_carousel_settings' ); 55 self::add_settings_field( ' hide_legacy_carousel', \__( 'HideOld Carousel Blocks', 'cb' ), $options );55 self::add_settings_field( 'show_legacy_blocks', \__( 'Show Old Carousel Blocks', 'cb' ), $options ); 56 56 self::add_settings_field( 'hide_legacy_notice', __( 'Hide Legacy Warning Notice', 'cb' ), $options ); 57 57 } … … 65 65 public static function sanitize( $input ) { 66 66 $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 73 76 return $sanitized_input; 74 77 } … … 103 106 $options = $args['options']; 104 107 $setting_id = $args['id']; 105 108 106 109 // Get original saved value 107 110 $saved_value = isset( $options[ $setting_id ] ) ? $options[ $setting_id ] : false; 108 111 109 112 // Build filter name 110 113 $filter_name = 'cb_carousel_block_setting_' . $setting_id; 111 114 112 115 // Get filtered value 113 116 $filtered_value = apply_filters( $filter_name, $saved_value, $setting_id ); 114 117 115 118 // Detect if a filter is attached 116 119 $forced_by_filter = has_filter( $filter_name ); 117 120 118 121 // Use filtered value for checkbox 119 122 $value = $filtered_value ? 1 : 0; 120 123 121 124 echo '<fieldset>'; 122 125 echo '<legend class="screen-reader-text"><span>' . esc_html( $args['id'] ) . '</span></legend>'; … … 124 127 echo '<input type="checkbox" id="' . esc_attr( $setting_id ) . '" name="cb_carousel_settings[' . esc_attr( $setting_id ) . ']" value="1"' . checked( 1, $value, false ) . '>'; 125 128 126 if ( $setting_id === ' hide_legacy_carousel' ) {127 echo __( ' Hide legacy (non-Swiper) Carousel Slider blocks fromthe editor inserter.', 'cb' );129 if ( $setting_id === 'show_legacy_blocks' ) { 130 echo __( 'Show legacy (non-Swiper) Carousel Slider blocks in the editor inserter.', 'cb' ); 128 131 } 129 132 130 133 if ( $setting_id === 'hide_legacy_notice' ) { 131 134 echo __( 'Hide the notice about legacy Carousel Slider blocks in the editor.', 'cb' ); 132 135 } 133 136 134 137 echo '</label>'; 135 138 136 139 if ( $forced_by_filter ) { 137 140 echo '<p style="margin: 4px 0 0; font-style: italic; color: #888;">' . __( 'This setting is overridden by a filter.', 'cb' ) . '</p>'; 138 141 } 139 142 140 143 echo '</fieldset>'; 141 } 144 } 142 145 143 146 /** … … 151 154 <p>Legacy blocks will continue to work, but are no longer recommended.</p> 152 155 <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> 156 159 </ul> 157 <p>You can optionally hide legacy blocks below.</p>160 <p>You can optionally re-enable legacy blocks below.</p> 158 161 </div> 159 162 -
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 6 6 * Author: Virgiliu Diaconu 7 7 * Author URI: http://virgiliudiaconu.com/ 8 * Version: 2.0. 08 * Version: 2.0.1 9 9 * License: GPL2+ 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt … … 24 24 * @var string 25 25 */ 26 define( 'CB_VERSION', '2.0. 0' );26 define( 'CB_VERSION', '2.0.1' ); 27 27 28 28 /** -
carousel-block/trunk/readme.txt
r3282685 r3282723 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.0 8 Stable tag: 2.0. 08 Stable tag: 2.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 61 61 - Legacy styles will not apply to v2. You may need to adjust custom styles. 62 62 63 **Optional: Hide Legacy Blocks**63 **Optional: Re-enable Legacy Blocks** 64 64 65 You can hide legacy blocks from the block inserter and disable v2 upgrade notices in the editorvia **Settings → Carousel Slider** in the admin menu.65 You can show/hide legacy blocks from the block inserter and disable v2 upgrade notices via **Settings → Carousel Slider** in the admin menu. 66 66 67 67 **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. … … 187 187 - Legacy blocks are still supported but can be upgraded to v2 via block transforms 188 188 - 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.