Skip to content

Commit

Permalink
Generate element classnames from element-specific data (#59533)
Browse files Browse the repository at this point in the history
Unlinked contributors: nitamorais.

Co-authored-by: tellthemachines <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: andrewserong <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: huubl <[email protected]>
  • Loading branch information
6 people committed Mar 4, 2024
1 parent a8d238b commit d9c88be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function gutenberg_render_elements_support( $block_content, $block ) {
*/
$tags = new WP_HTML_Tag_Processor( $block_content );
if ( $tags->next_tag() ) {
$tags->add_class( wp_get_elements_class_name( $block ) );
$tags->add_class( wp_get_elements_class_name( $elements_style_attributes ) );
}

return $tags->get_updated_html();
Expand Down Expand Up @@ -134,7 +134,7 @@ function gutenberg_render_elements_support_styles( $pre_render, $block ) {
return null;
}

$class_name = wp_get_elements_class_name( $block );
$class_name = wp_get_elements_class_name( $element_block_styles );

$element_types = array(
'button' => array(
Expand Down

0 comments on commit d9c88be

Please sign in to comment.