Last active
June 26, 2018 00:44
-
-
Save bnecreative/5abb77b595e9d9ec5e8164bb3d1315c1 to your computer and use it in GitHub Desktop.
Sweetness - Extend Font Awesome 5
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
<?php // Don't copy this line | |
/* | |
* Sweetness Font Awesome 5 Icon Set | |
* | |
* Extend implementation of Font Awesome 5 within Sweetness. Add more icons | |
* from the free version or implement the pro version. By default, | |
* Sweetness includes a custom build of the Font Awesome 5’s free version that | |
* provides the solid, most regular, and brand icon styles. | |
* | |
* If you’d like to include a custom build of Font Awesome 5 or if you are | |
* a Font Awesome Pro customer, you can use this filter to do that. | |
* | |
* @note Accessing Pro CDN assets may require a paid license from Font Awesome. | |
* @note Setting CSS to true will take precedence over JS. | |
* | |
*/ | |
add_filter( 'bne_fontawesome_setup', function( $fa ) { | |
// CSS Version | |
$fa['css'] = true; | |
// If not provided, the CSS version will default to the current CDN source. | |
$fa['sources']['css'] = 'https://website.com/path/to/file/fontawesome-all.css'; | |
// JS Version | |
$fa['sources']['js'] = 'https://website.com/path/to/file/fontawesome-all.js'; | |
// Shortcode Generator Data Set | |
// When using a new data set, you will need to clear the existing transient | |
// cache that sweetness uses. | |
$fa['sources']['icons'] = 'https://website.com/path/to/file/icons.json'; | |
// When using the SVG/JS icons, pseduo usage via :before CSS on a DOM element is disabled by default. | |
$fa['pseudo'] = true; | |
return $fa; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment