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: Fix 'Video' widget for YouTube and Vimeo, simplify 'Gallery' solution #921

Merged
merged 11 commits into from
Feb 3, 2018

Commits on Jan 31, 2018

  1. Issue #864: Address an issue in 'Video' widgets for YouTube and Vimeo.

    These widgets have different logic in:
    WP_Widget_Media_Video::render()
    So override the value of wp_video_shortcode(), which renders these.
    Produce 'youtube' or 'vimeo' shortcodes.
    And this plugin's handlers will create <amp-youtube> and <amp-vimeo>.
    Another plugin is also free to override those shortcodes.
    Ryan Kienstra committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    218fc9d View commit details
    Browse the repository at this point in the history
  2. Issue #864: Only override video widget output if is_amp_endpoint().

    Similarly to how the other widget overrides work.
    Also, adjust tests for this.
    Ryan Kienstra committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    cb0f071 View commit details
    Browse the repository at this point in the history
  3. Issue #864: Align equals signs in response to Travis error.

    Ryan Kienstra committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    6608df5 View commit details
    Browse the repository at this point in the history
  4. Issue #864: Simply return the initial value, instead of ''.

    This will allow another plugin to override this.
    Inspired by the Jetpack plugin's return of the initial value.
    Ryan Kienstra committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    76cf75f View commit details
    Browse the repository at this point in the history
  5. Issue #864: Remove the 'Gallery' widget subclass, in favor of a filter.

    Thanks to Weston for mentioning how we could use 'post_gallery.'
    Using this removes the need to subclass that widget.
    The widget calls gallery_shortcode(), which has the filter:
    'post_gallery'
    As Weston mentioned, Jetpack filters 'post_gallery'.
    Ryan Kienstra committed Jan 31, 2018
    Configuration menu
    Copy the full SHA
    9fab092 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2018

  1. Issue #864: Move video override logic into embed handlers.

    These are now in the embed classes.
    Also, create test classes for them.
    Ryan Kienstra committed Feb 1, 2018
    Configuration menu
    Copy the full SHA
    7c1f8fe View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2018

  1. Issue #864: Handle a 'fixed-height' issue with 'Video' widgets.

    When they use 'Media Library' videos, they output <amp-video>.
    The AMP_Video_Sanitizer added a 'layout' value of 'fixed-height'.
    The height of 400px didn't look good, as the aspect ratio was wrong.
    Instead, make video widgets that use <amp-video> use layout=responsive.
    Detect this by checking that neight 'width' or 'height' are present.
    inject_video_max_width_style() removes these attributes for the widget.
    Otherwise, retain the previous logic.
    Ryan Kienstra committed Feb 2, 2018
    Configuration menu
    Copy the full SHA
    a330342 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2018

  1. Revert "Issue #864: Handle a 'fixed-height' issue with 'Video' widgets."

    This reverts commit a330342.
    Ryan Kienstra committed Feb 3, 2018
    Configuration menu
    Copy the full SHA
    13b52da View commit details
    Browse the repository at this point in the history
  2. Issue #864: Video widget fixes, including width and height.

    Props @westonruter for the details of how to do this.
    Overrides the widget WP_Widget_Media_Video,
    in order to override the callback that strips the height and width.
    Also, add a style of 'width:100%' to the <amp-video>.
    This ensures that the widget doesn't overflow the container.
    Ryan Kienstra committed Feb 3, 2018
    Configuration menu
    Copy the full SHA
    ccba1c2 View commit details
    Browse the repository at this point in the history
  3. Issue #864: Fix an issue with the style placement, override 'Text.'

    Override the 'Text' widget.
    Prevent the stripping of <video> width and height attributes.
    Also, move the addition of the 'style' attribute.
    Before, it wasn't added.
    Ryan Kienstra committed Feb 3, 2018
    Configuration menu
    Copy the full SHA
    2e197d3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a6e7c36 View commit details
    Browse the repository at this point in the history