-
Notifications
You must be signed in to change notification settings - Fork 383
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
Account for filtering of gallery 'link' attribute #3439
Conversation
This usually worked, but it's still possible to set the attributes via the filter 'shortcode_atts_gallery'. So there was a user that relied on that filter, and that overwrote the previous link="file" value, and made it 'none'. So this adds a filter at a high priority.
$attributes['link'] = 'none'; | ||
$html = gallery_shortcode( $attributes ); | ||
$html = gallery_shortcode( $attributes ); |
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.
When gallery_shortcode() runs, it's possible to filter the $attributes
with the shortcode_atts_gallery filter.
And that can change the previous value of $attributes['link'] = 'none';
, causing the lightbox to not work.
Request For Review Hi @westonruter, You've probably looked at the code at least a little, but could you please do a formal review? It looks like this PR works for @rsmith4321:
Thanks, Weston! Have a great weekend. |
Thanks, Weston! |
Question about moving to 'Ready for Merging' Hi @westonruter, Would it be alright to move this to 'Ready for Merging,' without traditional QA? The steps to reproduce include adding a PHP filter. Thanks, Weston! |
Given it was already tested by the other Ryan, then yes, I moved it. |
Thanks, Weston! |
Summary
This fixes a case where a gallery lightbox doesn't open, when adding a
$atts['link'] = 'file'
to a'shortcode_atts_gallery'
filter.Addresses an edge case from issue #2850 (comment)
Steps to reproduce
Checklist