PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
elementor / core / page-assets / data-managers / font-icon-svg / manager.php

manager.php in Elementor Website Builder – more than just a page builder 3.28.0-dev2, at core/page-assets/data-managers/font-icon-svg/manager.php

55 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Page_Assets\Data_Managers\Font_Icon_Svg;
3
4 use Elementor\Core\Base\Base_Object;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor Font Icon Svg Manager.
12 *
13 * @since 3.4.0
14 */
15 class Manager extends Base_Object {
16 private static $data = [];
17
18 private static function get_data() {
19 if ( ! self::$data ) {
20 self::$data = [
21 'font-awesome' => [
22 'regex' => '/^fa-/',
23 'manager' => new Font_Awesome(),
24 ],
25 'eicons' => [
26 'regex' => '/^eicons$/',
27 'manager' => new E_Icons(),
28 ],
29 ];
30 }
31
32 return self::$data;
33 }
34
35 public static function get_font_icon_svg_data( $icon ) {
36 $data = self::get_data();
37
38 $font_family = $icon['font_family'];
39
40 $font_family_manager = $data[ $font_family ]['manager'];
41
42 return $font_family_manager->get_asset_data( $icon );
43 }
44
45 public static function get_font_family( $icon_library ) {
46 foreach ( self::get_data() as $family => $data ) {
47 if ( preg_match( $data['regex'], $icon_library ) ) {
48 return $family;
49 }
50 }
51
52 return '';
53 }
54 }
55