Skip to content
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

Issue #864: Support <amp-carousel> in 'Gallery' widget. #917

Merged
merged 5 commits into from
Jan 30, 2018

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Jan 30, 2018

Request For Code Review

Hi @ThierryA or @westonruter,
Could you please review this pull request, which makes the 'Gallery' widget use an <amp-carousel>?

new-media-gallery-widget

It overrides the 'Gallery' widget's render() function, and uses the embed handler for galleries.

Before, the gallery appeared without a carousel, and of course unstyled:
gallery-widget

Fixes #864.

Ryan Kienstra added 3 commits January 29, 2018 18:26
There's an existing handler to create 'amp-carousel' elements:
class AMP_Gallery_Embed_Handler.
So override the 'Gallery' widget class.
And use that in render_media().
Otherwise, that function is copied from the parent.
The parent calls gallery_shortcode() at the end of render_media().
And that function doesn't have a filter for the markup.
Don't subclass the widget if it doesn't exist.
And don't test the subclass if it's not present.
Before, there was an error,
As it instantiated AMP_Widget_Media_Gallery if it didn't exist.
@westonruter westonruter added this to the v0.7 milestone Jan 30, 2018
@westonruter westonruter merged commit f697603 into develop Jan 30, 2018
@westonruter westonruter deleted the add/864-gallery-widget-carousel branch February 3, 2018 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants