forked from tevko/wp-tevko-responsive-images
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make callback filter a full utility filter and pass full
img
HTML
Now that we're no longer using a `preg_replace_callback` function in `tevkori_filter_content_images()`, it doesn't make as much sense to use the callback function the way we originally set it up. However, rather that merging the two function, this turns the callback into a useful utility function that accepts an `img` element and returns the HTML including `srcset` and `sizes` attributes if we can. Additionally, since we only add `srcset` and `sizes` when we're able to parse the attachment id from the markup, we also no longer need to limit our matches in the content filter by files containing the path to our uploads folder. This resolves #190.
- Loading branch information
Showing
1 changed file
with
54 additions
and
84 deletions.
There are no files selected for viewing
This file contains 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