Merged
Conversation
…g as stale" This reverts commit 24cc73a.
This comment has been minimized.
This comment has been minimized.
westonruter
commented
Aug 3, 2020
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
westonruter
commented
Aug 4, 2020
swissspidy
reviewed
Aug 5, 2020
| <body> | ||
| <amp-story | ||
| standalone="standalone" | ||
| standalone="" |
Collaborator
There was a problem hiding this comment.
swissspidy
reviewed
Aug 5, 2020
swissspidy
reviewed
Aug 5, 2020
swissspidy
approved these changes
Aug 6, 2020
spacedmonkey
reviewed
Aug 6, 2020
Contributor
|
One nitpic, but otherwise, we are looking good. |
# Conflicts: # includes/Plugin.php # tests/phpunit/tests/Story_Post_Type.php
Codecov Report
@@ Coverage Diff @@
## main #3621 +/- ##
==========================================
- Coverage 83.72% 83.51% -0.21%
==========================================
Files 775 775
Lines 13380 13428 +48
==========================================
+ Hits 11203 11215 +12
- Misses 2177 2213 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2 tasks
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
This PR improves compatibility with the AMP plugin:
web-storyor the Validated URL screen is being viewed for aweb-story.web-storiesinto the list of supported post types when requesting a web story. When not requesting a web story, exclude theweb-storiespost type from the list of supportable post types. This prevents the post type from appearing among the list of post types which can be enabled/disabled on the AMP Settings screen (as of v2.0).Adds workaround forstandalone="standalone"being flagged as a validation error. This was resulting in thebodyelement being emptied out when serving anamp-story. The AMP plugin needs to be updated to allow the attribute value to replicate the attribute name for such boolean attributes. See Boolean attributes erroneously flagged as validation errors when name copied as value ampproject/amp-wp#5156.amp-story-playerAMP component by renaming the handle used for the AMP Story block to bestandalone-amp-story-player. This is only enqueued if not on an AMP page since otherwise it will be added automatically. This fixes a 404 error I saw in the editor:Relevant Technical Choices
The changes in this PR are in lieu of there being a more centralized way of conditionally switching the template mode given the request. When/if that happens, much of the code in this PR can be revised. The closest issue for that presently is ampproject/amp-wp#2817.
The logic in
Story_Post_Type::get_request_post_type()is admittedly hacky!User-facing changes
“Stories” will no longer appear in the list of post types that can be enabled for AMP.
Testing Instructions
developbranch (2.0-beta2)Fixes #3257
Fixes #1276