Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #146 from roots/relative-urls-for-resp-imgs
Browse files Browse the repository at this point in the history
Add relative URLs to responsive images output
  • Loading branch information
retlehs committed Mar 7, 2016
2 parents eb46111 + e5aec14 commit 560dafc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Add relative URLs to responsive images output ([#146](https://github.com/roots/soil/issues/146))
* Disable relative URLs in feeds ([#145](https://github.com/roots/soil/issues/145))
* Switch from Google CDN to jQuery CDN ([#144](https://github.com/roots/soil/issues/144))

Expand Down
7 changes: 7 additions & 0 deletions modules/relative-urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@
'style_loader_src'
]);
Utils\add_filters($root_rel_filters, 'Roots\\Soil\\Utils\\root_relative_url');

add_filter('wp_calculate_image_srcset', function ($sources) {
foreach ($sources as $source => $src) {
$sources[$source]['url'] = \Roots\Soil\Utils\root_relative_url($src['url']);
}
return $sources;
});

0 comments on commit 560dafc

Please sign in to comment.