-
Notifications
You must be signed in to change notification settings - Fork 384
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
Improve handling of URLs and location redirects in AMP #1203
Conversation
…ed amp theme support
…nical() Deprecate amp-frontend-actions.php in favor of adding function to amp-helper-functions.php.
…s change * Fix validation when switching between native and paired modes. * Only store canonical URLs for amp_invalid_url posts. * Fix issue with get_current_screen() not returning an object.
…ss private/drafted posts Partially reverts 90eff4f
I'm not able to reproduce this behaviour. I tried with/without |
@gravityrail humm, the I just double-checked and it's working for me:
😕 |
Ah! Now I'm able to reproduce the desired behaviour. The trick is to enable paired mode, which requires specifying a theme directory to AMP-ify:
Then you ALSO need to make sure you accept any validation errors that have been generated (otherwise it always redirects from AMP to non-AMP versions of page) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works :)
Hi! Will |
@artkanna Can you give an example of pages that were previously redirected? |
/amp/
endpoint to?amp
whenamp
theme support is present. This is important for plugins to be able to reliably callis_amp_endpoint()
. See Discontinue use of amp endpoint in favor of query var when amp theme support is present #1148.amp_get_current_url()
helper function.amp_add_amphtml_link()
replace the poorly-namedamp_frontend_add_canonical()
function and improve how it is referenced.old_slug_redirect_url
handling for AMP theme support. This ensures that AMP URLs redirect properly when changing a post's slug.amp_invalid_url
posts.get_current_screen()
not returning an object.Fixes #1166.