| @@ -217,9 +217,17 @@ | ||
| 217 | 217 | unset( $attributes['data-object-fit'] ); |
| 218 | 218 | unset( $attributes['data-object-position'] ); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - $output = '<picture' . $this->build_attributes( $attributes ) . ">\n"; | |
| 221 | + $picture_attributes = array_filter( | |
| 222 | + $attributes, | |
| 223 | + function ( $attribute ) { | |
| 224 | + return strpos( $attribute, 'data-wp' ) === false; | |
| 225 | + }, | |
| 226 | + ARRAY_FILTER_USE_KEY | |
| 227 | + ); | |
| 228 | + | |
| 229 | + $output = '<picture' . $this->build_attributes( $picture_attributes ) . ">\n"; | |
| 222 | 230 | /** |
| 223 | 231 | * Allow to add more <source> tags to the <picture> tag. |
| 224 | 232 | * |
| 225 | 233 | * @since 1.9 |