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

Address issues from testing with WordPress 5.0 #1627

Merged
merged 7 commits into from
Nov 20, 2018
Merged

Commits on Nov 20, 2018

  1. Ensure images with the aligncenter class are centered

    When <img> tags have an 'aligncenter' class,
    AMP_Img_Sanitizer::handle_centering() wraps theme in
    <figure class=aligncenter>.
    This ensures that the image inside it is centered.
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    93a3967 View commit details
    Browse the repository at this point in the history
  2. Remove the sizes attribute from thumbnail images in Twenty Nineteen

    The AMP runtime sets an inline style on an <amp-img> based
    on the sizes attribute if it's present.
    For example, <amp-img style="width:calc(50vw)">.
    Removing the 'sizes' attribute isn't ideal, but it looks
    like it's not possible to override that inline style.
    This is only a workaround until the issue is addressed
    in the amphtml repo.
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    d7de7d1 View commit details
    Browse the repository at this point in the history
  3. Fall back to the normal gallery shortcode markup for 'thumbnail' size.

    If the 'gallery' shortcode has a 'size' attribute of 'thumbnail',
    prevent outputting an <amp-carousel>.
    That will often get thumbnail images around 150 x 150,
    while the <amp-carousel> usually has a width of 600 and a height of 480.
    That often means very low-resolution images.
    So fall back to the normal 'gallery' shortcode callback, gallery_shortcode().
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    1afa46b View commit details
    Browse the repository at this point in the history
  4. Prevent horizontall-compressed images in Gallery block

    There's a style rule that prevents these from compressing.
    img { object-fit: cover; }
    This selector seems to be changed to amp-img in style sanitization,
    but it doesn't have the same effect as when applied to img
    So copy the style rule verbatim into a stylesheet.
    This is in AMP_Gallery_Embed_Handler,
    as it's too late to enqueue_style,
    'wp_print_styles' has already run by the time
    that sanitizer runs.
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    c9e0f03 View commit details
    Browse the repository at this point in the history
  5. Bump 'Tested up to' version to 5.0

    As Weston has mentioned,
    there's no need to have any more specificity than this,
    like 5.0-beta5
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    0a0b134 View commit details
    Browse the repository at this point in the history
  6. Update includes/embeds/class-amp-gallery-embed.php

    Apply Weston's suggestion to change add_filter() to add_action()
    
    Co-Authored-By: kienstra <kienstraryan@gmail.com>
    westonruter and kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    443bd9b View commit details
    Browse the repository at this point in the history
  7. Move the enqueued stylesheet into a callback for 'wp_print_styles'

    As Weston mentioned, it's not necessary to enqueue a stylesheet
    that only has one rule.
    So output it in a callback for 'wp_print_styles'
    kienstra committed Nov 20, 2018
    Configuration menu
    Copy the full SHA
    6b7d305 View commit details
    Browse the repository at this point in the history