Skip to content

Commit

Permalink
Update elements block support to use shared function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Oct 12, 2021
1 parent bdab1bd commit 9385b59
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,7 @@ function gutenberg_render_elements_support( $block_content, $block ) {
$content = substr_replace( $block_content, ' class="' . $class_name . '"', $first_element_offset + strlen( $first_element ) - 1, 0 );
}

// Ideally styles should be loaded in the head, but blocks may be parsed
// after that, so loading in the footer for now.
// See https://core.trac.wordpress.org/ticket/53494.
add_action(
'wp_footer',
function () use ( $style ) {
echo $style;
}
);
gutenberg_render_block_support_style( $style );

return $content;
}
Expand Down

0 comments on commit 9385b59

Please sign in to comment.