-
Notifications
You must be signed in to change notification settings - Fork 381
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
Allow opting-out of AMP-to-AMP links, ensure 'Exit Reader Mode' link is non-AMP #4146
Commits on Jan 21, 2020
-
Allow opting-out of AMP-to-AMP links with rel=not-amphtml
As Weston suggested, this forces links to non-AMP.
Configuration menu - View commit details
-
Copy full SHA for 92d0f28 - Browse repository at this point
Copy the full SHA 92d0f28View commit details -
Ensure the 'Exit Reader Mode' link goes to non-AMP
Even if add_filter( 'amp_to_amp_linking_enabled', '__return_true' ); is present, this should still go to non-AMP.
Configuration menu - View commit details
-
Copy full SHA for 3feb885 - Browse repository at this point
Copy the full SHA 3feb885View commit details -
Add a filter to opt-out of AMP-to-AMP links
When in Reader or Transitional mode, links to the same origin will usually be to AMP. But this filter enables passing URLs that will link to non-AMP, not AMP.
Configuration menu - View commit details
-
Copy full SHA for 10f423a - Browse repository at this point
Copy the full SHA 10f423aView commit details -
Simplify a conditional to use an elseif block
The if block only ran if the previous block didn't, so an elseif block probably makes sense here.
Configuration menu - View commit details
-
Copy full SHA for 9409786 - Browse repository at this point
Copy the full SHA 9409786View commit details -
Add some comments in unit test
It's not very clear what these are testing without the comments.
Configuration menu - View commit details
-
Copy full SHA for 404455d - Browse repository at this point
Copy the full SHA 404455dView commit details -
Remove needless variable, move into conditional
There's no need to store this in a variable, So simply move the boolean to the conditional.
Configuration menu - View commit details
-
Copy full SHA for 64ddd3e - Browse repository at this point
Copy the full SHA 64ddd3eView commit details -
Rename filter amp_to_amp_excluded_links
This is clearer that it's in the AMP plugin, as the beginning serves as a sort of prefix.
Configuration menu - View commit details
-
Copy full SHA for 25b02fb - Browse repository at this point
Copy the full SHA 25b02fbView commit details -
Handle cases of multpile rel values, using Weston's snippets
The rel attribute can have multiple space-separated values: https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types
Configuration menu - View commit details
-
Copy full SHA for 8a2e3da - Browse repository at this point
Copy the full SHA 8a2e3daView commit details -
Update includes/sanitizers/class-amp-link-sanitizer.php
Commit Weston's suggestion Co-Authored-By: Weston Ruter <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 640834f - Browse repository at this point
Copy the full SHA 640834fView commit details -
Address failed Travis build: PHPCS array_search() warning
Pass a 3rd argument of true to array_search() so that Travis passes.
Configuration menu - View commit details
-
Copy full SHA for 3b58df0 - Browse repository at this point
Copy the full SHA 3b58df0View commit details
Commits on Jan 22, 2020
-
Update unit tests for new rel value
Now that it's changed to noamphtml, update this in the unit tests also.
Configuration menu - View commit details
-
Copy full SHA for ffec7e5 - Browse repository at this point
Copy the full SHA ffec7e5View commit details
Commits on Jan 23, 2020
-
Commit Weston's suggestion for the Reader mode template
The rel value was changed to noamphtml, so it should be reflected here also. Co-Authored-By: Weston Ruter <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ff931c3 - Browse repository at this point
Copy the full SHA ff931c3View commit details -
Change DocBlock of 'amp_to_amp_excluded_links'
Using Weston's suggestion in the pull request.
Configuration menu - View commit details
-
Copy full SHA for 77118d7 - Browse repository at this point
Copy the full SHA 77118d7View commit details -
Change filter name to 'amp_to_amp_excluded_urls'
As Weston pointed out, this is filtering URLs.
Configuration menu - View commit details
-
Copy full SHA for d953a27 - Browse repository at this point
Copy the full SHA d953a27View commit details -
Rename parameter 'excluded_amp_links' to 'excluded_urls'
These are not really links, they're URLs.
Configuration menu - View commit details
-
Copy full SHA for b6dda38 - Browse repository at this point
Copy the full SHA b6dda38View commit details -
Handle case of something like #heading at end of URL
As Weston mentioned, this shouldn't be used in comparison.
Configuration menu - View commit details
-
Copy full SHA for f85e8be - Browse repository at this point
Copy the full SHA f85e8beView commit details -
Commit Weston's suggestion to prevent conditional in Standard mode
Co-Authored-By: Weston Ruter <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a6d1597 - Browse repository at this point
Copy the full SHA a6d1597View commit details -
Add a since tag to the new filter amp_to_amp_excluded_urls
As Weston mentioned, this didn't have one.
Configuration menu - View commit details
-
Copy full SHA for 160eb87 - Browse repository at this point
Copy the full SHA 160eb87View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4701234 - Browse repository at this point
Copy the full SHA 4701234View commit details -
Fix some phpcs errors, mainly => alignment
Do npm run lint:php:fix to fix some of these.
Configuration menu - View commit details
-
Copy full SHA for 101b38d - Browse repository at this point
Copy the full SHA 101b38dView commit details