Add filters to modify the cached URLs#48
Open
carlalexander wants to merge 1 commit intoberkmancenter:wordpressfrom
Open
Add filters to modify the cached URLs#48carlalexander wants to merge 1 commit intoberkmancenter:wordpressfrom
carlalexander wants to merge 1 commit intoberkmancenter:wordpressfrom
Conversation
Contributor
Author
|
Just a note on the Travis errors. It seems like the Travis config doesn't work for PHP 5.3 or HHVM. HHVM could probably be dropped since WordPress doesn't support it anymore either. |
c7f0cf6 to
712d2dc
Compare
jlicht
reviewed
Nov 1, 2018
| } | ||
|
|
||
| private static function cache_link($item, $force = false) { | ||
| $item = apply_filters('amber_cache_link', item); |
Collaborator
There was a problem hiding this comment.
Suggested change
| $item = apply_filters('amber_cache_link', item); | |
| $item = apply_filters('amber_cache_link', $item); |
jlicht
reviewed
Nov 1, 2018
| private static function cache_link($item, $force = false) { | ||
| $item = apply_filters('amber_cache_link', item); | ||
|
|
||
| if (empty($link)) { |
Collaborator
There was a problem hiding this comment.
Suggested change
| if (empty($link)) { | |
| if (empty($item)) { |
Collaborator
|
Thanks for this pull request! Can you give us permission to make modifications, as per https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/ |
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.
This is PR is part of a fix for #44. It adds two filters to the amber link caching process. One during the enqueue process and another during the lookup. This lets us edit links before Amber tries to cache them. We then modify those links again when Amber looks them up.
Here's an example of the use of these filters to fix the issue in #44: