-
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
Set AMP_QUERY_VAR fallback when AMP is inactive #986
Conversation
We may also want to consider hardening up the helper functions as well to return appropriate values when AMP is disabled via the filter. |
See also #945. What have been the use cases for |
One example is http://indianexpress.com/article/india/breakthrough-journalist-gauri-lankesh-murder-first-arrest-5084078/lite/ (they use Deprecation is fine too :) |
I think this might be the better way to go instead of defining |
If AMP is deactivated via the `amp_is_enabled` filter, the `AMP_QUERY_VAR` ends up undefined. This causes warnings when a helper function like `is_amp_endpoint()` is called. Setting a fallback value prevents this.
82dced4
to
d024c4c
Compare
Rebased to fix merge conflict. Former |
Sounds like a good idea. |
@westonruter I see this PR is now approved, does it still need my review? |
@ThierryA I just wanted you to be aware of it. |
If AMP is deactivated via the
amp_is_enabled
filter, theAMP_QUERY_VAR
ends up undefined. This causes warnings when a helper function likeis_amp_endpoint()
is called. Setting a fallback value prevents this.This was happening with a site running both
amp-wp
(but deactivated via the filter) andlazy-load
(which callsis_amp_endpoint()
):To reproduce: