Print amp-default.css via amp_post_template_css action instead of in style.php template#5282
Merged
westonruter merged 3 commits intodevelopfrom Aug 27, 2020
Merged
Conversation
…style.php template
Contributor
|
Plugin builds for ce230e6 are ready 🛎️!
|
pierlon
approved these changes
Aug 27, 2020
Member
Author
|
Got a change to improve how this is done… |
Member
Author
|
For the sake of completeness, I'm adding @schlessera and @johnwatkins0 as reviewers in case they can think of any other implications of making this change, given that we would send this straight out without an RC. |
Member
Author
schlessera
requested changes
Aug 27, 2020
schlessera
approved these changes
Aug 27, 2020
westonruter
added a commit
that referenced
this pull request
Aug 27, 2020
…style.php template (#5282)
Member
Author
|
This is now available as part of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes https://wordpress.org/support/topic/no-photos-showing-since-update-2-0/
When a theme has customized their
style.phptemplate so that it does not include the manual inclusion ofamp-default.css, the result is changes to that stylesheet will not be included. So if someone has a Gallery block that is showing as a slideshow, it won't render properly if this CSS fromamp-default.cssis not added to the page:amp-wp/assets/css/src/amp-default.css
Lines 76 to 79 in f44c07f
If the theme does not intentionally include
amp-default.csslike so:amp-wp/templates/style.php
Line 97 in f44c07f
Then they won't get such rules.
We can avoid this from happening in the future by printing
amp-default.cssvia theamp_post_template_cssaction, rather than manually printing it in thestyle.php.This workaround code also does the trick:
Checklist