font-awesome.php (1098B)
1 <?php 2 namespace Elementor\Core\Page_Assets\Managers\Font_Icon_Svg; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; // Exit if accessed directly. 6 } 7 8 /** 9 * Elementor Font Icon Svg. 10 * 11 * @since 3.4.0 12 */ 13 class Font_Awesome extends Base { 14 const FONT_AWESOME_CURRENT_VERSION = 5; 15 16 protected static function get_font_name() { 17 return 'font-awesome'; 18 } 19 20 protected static function get_config_file_path() { 21 $icon_file_name = str_replace( 'fa-', '', self::$icon['library'] ); 22 23 return ELEMENTOR_ASSETS_PATH . 'lib/font-awesome/json/' . $icon_file_name . '.json'; 24 } 25 26 protected static function get_config_key() { 27 // i.e. 'fab-apple' | 'far-cart'. 28 return str_replace( ' fa-', '-', self::$icon['value'] ); 29 } 30 31 protected static function get_config_version() { 32 return self::FONT_AWESOME_CURRENT_VERSION; 33 } 34 35 protected static function get_config_data() { 36 preg_match( '/fa(.*) fa-/', self::$icon['value'], $matches ); 37 $icon_name = str_replace( $matches[0], '', self::$icon['value'] ); 38 39 return [ 40 'icon_data' => [ 41 'name' => $icon_name, 42 'library' => self::$icon['library'], 43 ], 44 ]; 45 } 46 }