plugin updates

This commit is contained in:
Tony Volpe
2024-11-15 13:53:04 -05:00
parent 1293d604ca
commit 0238f0c4ca
2009 changed files with 163492 additions and 89543 deletions

View File

@@ -7,21 +7,6 @@
* @since 6.6.0
*/
/**
* Generate block style variation instance name.
*
* @since 6.6.0
* @access private
*
* @param array $block Block object.
* @param string $variation Slug for the block style variation.
*
* @return string The unique variation name.
*/
function wp_create_block_style_variation_instance_name( $block, $variation ) {
return $variation . '--' . md5( serialize( $block ) );
}
/**
* Determines the block style variation names within a CSS class string.
*
@@ -124,7 +109,7 @@ function wp_render_block_style_variation_support_styles( $parsed_block ) {
*/
wp_resolve_block_style_variation_ref_values( $variation_data, $theme_json );
$variation_instance = wp_create_block_style_variation_instance_name( $parsed_block, $variation );
$variation_instance = wp_unique_id( $variation . '--' );
$class_name = "is-style-$variation_instance";
$updated_class_name = $parsed_block['attrs']['className'] . " $class_name";
@@ -230,11 +215,9 @@ function wp_render_block_style_variation_class_name( $block_content, $block ) {
/*
* Matches a class prefixed by `is-style`, followed by the
* variation slug, then `--`, and finally a hash.
*
* See `wp_create_block_style_variation_instance_name` for class generation.
* variation slug, then `--`, and finally an instance number.
*/
preg_match( '/\bis-style-(\S+?--\w+)\b/', $block['attrs']['className'], $matches );
preg_match( '/\bis-style-(\S+?--\d+)\b/', $block['attrs']['className'], $matches );
if ( empty( $matches ) ) {
return $block_content;