Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/Webp/Picture/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ protected function build_picture_tag( $image ) {
unset( $attributes['data-object-position'] );
}

$output = '<picture' . $this->build_attributes( $attributes ) . ">\n";
$picture_attributes = array_filter( $attributes, function ( $attribute ) {
return strpos( $attribute, 'data-wp' ) === false;
}, ARRAY_FILTER_USE_KEY );

$output = '<picture' . $this->build_attributes( $picture_attributes ) . ">\n";
/**
* Allow to add more <source> tags to the <picture> tag.
*
Expand Down