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- $ block_type = WP_Block_Type_Registry::get_instance ()->get_registered ( $ parsed_block ['blockName ' ] );
17+ // Check if the custom CSS attribute even exists.
18+ $ custom_css = $ parsed_block ['attrs ' ]['style ' ]['css ' ] ?? '' ;
1819
19- if ( ! block_has_support ( $ block_type , ' customCSS ' , true ) ) {
20+ if ( empty ( trim ( $ custom_css ) ) ) {
2021 return $ parsed_block ;
2122 }
2223
23- $ custom_css = trim ( $ parsed_block ['attrs ' ][ ' style ' ][ ' css ' ] ?? '' );
24+ $ block_type = WP_Block_Type_Registry:: get_instance ()-> get_registered ( $ parsed_block ['blockName ' ] );
2425
25- if ( empty ( $ custom_css ) ) {
26+ if ( ! block_has_support ( $ block_type , ' customCSS ' , true ) ) {
2627 return $ parsed_block ;
2728 }
2829
You can’t perform that action at this time.
0 commit comments