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 5 commits into from Jan 30, 2018


None yet
3 participants
Copy link

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>?


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:

Fixes #864.

kienstra added some commits Jan 30, 2018

Issue #864: Support <amp-carousel> in 'Gallery' widget.
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.
Issue #864: Accomodate WP versions < 4.9, without the 'Gallery' widget.
Don't subclass the widget if it doesn't exist.
And don't test the subclass if it's not present.
Issue #864: Move the markTestSkipped() higher in the function.
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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@westonruter westonruter deleted the add/864-gallery-widget-carousel branch Feb 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.