DEV: Refactor custom svg icon caching (#13483)

Previously, we were storing custom svg sprite paths in the cache. This is a problem because sprites in themes get stored as uploads, and the returned paths were files in the temporary download cache which could sometimes be cleaned up, resulting in a broken cache.

I previously tried to fix this by skipping the missing files and clearing the cache, but that didn't work out well with CDNs. This PR stores the contents of the files in the custom_svg_sprites cache to avoid the problem of missing temp files.

Also, plugin custom icons are only included if the plugin is enabled.
This commit is contained in:
Penar Musaraj
2021-06-22 14:07:23 -04:00
committed by GitHub
parent 7fc3d7bdde
commit fc0da499f8
3 changed files with 110 additions and 52 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="custom-icon" viewBox="0 0 512 512">
<g>
<g>
<path d="M425.199,223.957c-13.303-13.303-34.961-13.303-48.205-0.06l-86.861,85.086V34.133C290.133,15.309,274.824,0,256,0"/>
</g>
</g>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 318 B