-
Notifications
You must be signed in to change notification settings - Fork 31
Added a fix for the lightbox #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 5 commits
d218e9c
e0bad90
2515e56
d018206
b3b7d66
4ea5bf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,7 +218,15 @@ 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 | ||
| ); | ||
|
Comment on lines
+221
to
+227
|
||
|
|
||
| $output = '<picture' . $this->build_attributes( $picture_attributes ) . ">\n"; | ||
| /** | ||
| * Allow to add more <source> tags to the <picture> tag. | ||
| * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current check using
strpos($attribute, 'data-wp') === falsewill filter out any attribute containing 'data-wp' anywhere in the key name, not just those starting with 'data-wp'. For more precise filtering of WordPress-specific attributes, consider usingstrpos($attribute, 'data-wp-') !== 0orstrncmp($attribute, 'data-wp-', 8) !== 0to ensure only attributes that start with 'data-wp-' are filtered out. This prevents accidentally filtering attributes that may contain 'data-wp' in other positions.