Skip to content

Commit

Permalink
Allow slug for variations coming from partials
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Jun 13, 2024
1 parent fe8fe40 commit a602aae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/block-supports/block-style-variations.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ function gutenberg_register_block_style_variations_from_theme_json_data( $variat
* Block style variations read in via standalone theme.json partials
* need to have their name set to the kebab case version of their title.
*/
$variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] );
$variation_name = $have_named_variations ? $key : ( $variation['slug'] ?? _wp_to_kebab_case( $variation['title'] ) );
$variation_label = $variation['title'] ?? $variation_name;

foreach ( $supported_blocks as $block_type ) {
Expand Down

0 comments on commit a602aae

Please sign in to comment.