File tree Expand file tree Collapse file tree
src/wp-includes/block-supports Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 * @return array The same parsed block with custom CSS class name added if appropriate.
1515 */
1616function wp_render_custom_css_support_styles ( $ parsed_block ) {
17- // Check if the custom CSS attribute even exists.
18- $ custom_css = $ parsed_block ['attrs ' ]['style ' ]['css ' ] ?? '' ;
17+ $ custom_css = trim ( $ parsed_block ['attrs ' ]['style ' ]['css ' ] ?? '' );
1918
20- if ( empty ( trim ( $ custom_css ) ) ) {
19+ if ( empty ( $ custom_css ) ) {
2120 return $ parsed_block ;
2221 }
2322
@@ -81,7 +80,6 @@ function wp_enqueue_block_custom_css() {
8180function wp_render_custom_css_class_name ( $ block_content , $ block ) {
8281 $ class_string = $ block ['attrs ' ]['className ' ] ?? '' ;
8382
84- /* If there is no class string, there is no custom CSS class to add, so return early. */
8583 if ( '' === $ class_string ) {
8684 return $ block_content ;
8785 }
You can’t perform that action at this time.
0 commit comments