Is there no plugin to do rewrites for the assets directory so that you don’t have to use the function to get the theme directory? I’ve got soil and soil-relative-urls installed but maybe that’s not it?
We don’t recommend, support or maintain it, but it’s available at https://github.com/roots/roots-rewrites
May I ask why is it not recommended to do rewrites for the assets directory?
It was a vanity thing - nobody except people who looked at your page source would know or care if things were being loaded from /wp-content/themes/sage/assets/js
or /assets/js
. It also has the potential to break and cause issues down the road.
It was deprecated when Bedrock was released, as you get the benefit of a cleaner structure, app
instead of wp-content
, and you don’t have to deal with rewrites any longer.
1 Like