getAttribute( 'style' ) ); foreach ( array_keys( $spacing ) as $attribute ) { $prop = $attribute === 'blockGap' ? 'gap' : $attribute; if ( is_string( $spacing[ $attribute ] ) ) { $styles[ $prop ] = format_custom_property( $spacing[ $attribute ] ); } if ( is_array( $spacing[ $attribute ] ) ) { foreach ( array_keys( $spacing[ $attribute ] ) as $side ) { $styles[ "$prop-$side" ] = format_custom_property( $spacing[ $attribute ][ $side ] ); } } } if ( $styles ) { $nav->setAttribute( 'style', css_array_to_string( $styles ) ); } $buttons = get_elements_by_class_name( $dom, 'wp-block-navigation-submenu__toggle' ); foreach ( $buttons as $button ) { $span = $button->nextSibling; if ( ! $span || $span->tagName !== 'span' ) { continue; } $span->parentNode->removeChild( $span ); $button->appendChild( $span ); } $html = $dom->saveHTML(); return $html; }