Last Updated on June 26, 2018
Filed under Dev

Extend Font Awesome 5 Icons

Sweetness comes packed with an extensive icon set called Font Awesome v5. This is the free version that includes the solid and most regular icon styles - 1,264 Free Icons. Starting with Sweetness v1.6.1, you can now extend how we provide Font Awesome by using the CSS version, an alternate icon data set, or expand to the full Pro version.

Pro Customers! If using the CDN source, you will need to make sure you included your domain within fontawesome.com as this is restricted to paid users only.

There are two ways to go about extending Font Awesome 5 within Sweetness...

1. Use our Font Awesome 5 Extension plugin. This plugin is available here. Once activated, it will provide two additional settings within Theme Options under General > General Settings. This will allow you to define an alternate path to the main js file and incorporate a different icon database used in the Shortcode Generator.

Download Plugin

 

2. Use the below filter. This would be the more ideal solution as you'll have a few additional options. The filter allows you to switch to a CSS version of Font Awesome 5 in addition to using a different JS or Pro version.

The above filter shows all the available options, but you only need to include what you are adjusting. If you are preferring the CSS route, then you only need to set the first option; whereas pro customers may want to use the JS source and icon data set options.

How to clear transient cache?

Prior to Sweetness v1.6.1, the vector icons are stored in the database for 7 days so that the processing of the data file does not tax your post editing experience. Starting with v1.6.1, this time was reduced to 24 hours (1 day).  To clear the cache immediately, you would need to use a transient plugin such as Transients Manager. From there you can do a search for "vector" and you should find one listed as bne_sweetness_v{version_number}_vector_icons. Simply delete this and your new icon data set will process the next time you open the shortcode generator. The default transient from Sweetness automatically clears on theme version updates.