getAttribute( 'style' ) ); $color = $attrs['style']['color'] ?? []; if ( isset( $color['background'] ) ) { $styles['background'] = $color['background']; } if ( isset( $attrs['backgroundColor'] ) ) { $styles['background'] = 'var(--wp--preset--color--' . $attrs['backgroundColor'] . ')'; } if ( isset( $color['gradient'] ) ) { $styles['background'] = $color['gradient']; } if ( isset( $attrs['gradient'] ) ) { $styles['background'] = 'var(--wp--preset--gradient--' . $attrs['gradient'] . ')'; } if ( isset( $color['text'] ) ) { $styles['color'] = $color['text']; } if ( isset( $attrs['textColor'] ) ) { $styles['color'] = 'var(--wp--preset--color--' . $attrs['textColor'] . ')'; } $styles = css_array_to_string( $styles ); if ( $styles ) { $first->setAttribute( 'style', $styles ); } else { $first->removeAttribute( 'style' ); } if ( $first->tagName === 'header' ) { $first->setAttribute( 'role', 'banner' ); $first->setAttribute( 'id', 'top' ); } if ( $first->tagName === 'footer' ) { $first->setAttribute( 'role', 'contentinfo' ); } return $dom->saveHTML(); }