getAttribute( 'style' ) ); foreach ( $shadow as $property => $value ) { if ( ! $value ) { continue; } $px = in_array( $property, [ 'x', 'y', 'blur', 'spread' ], true ) ? 'px' : ''; $styles[ '--wp--custom--box-shadow--' . $property ] = $value . $px; } if ( ! isset( $styles['--wp--custom--box-shadow--inset'] ) ) { $styles['--wp--custom--box-shadow--inset'] = ''; } $img->setAttribute( 'style', css_array_to_string( $styles ) ); $classes = explode( ' ', $img->getAttribute( 'class' ) ); $classes[] = 'has-box-shadow'; $img->setAttribute( 'class', implode( ' ', $classes ) ); $html = $dom->saveHTML(); } return $html; }