1 | <?php |
||
21 | class Kirki_Modules_Webfonts { |
||
22 | |||
23 | /** |
||
24 | * The object instance. |
||
25 | * |
||
26 | * @static |
||
27 | * @access private |
||
28 | * @since 3.0.0 |
||
29 | * @var object |
||
30 | */ |
||
31 | private static $instance; |
||
32 | |||
33 | /** |
||
34 | * Which method to use when loading googlefonts. |
||
35 | * Available options: link, js, embed. |
||
36 | * |
||
37 | * @static |
||
38 | * @access private |
||
39 | * @since 3.0.0 |
||
40 | * @var string |
||
41 | */ |
||
42 | private static $method = array( |
||
43 | 'global' => 'embed', |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * Whether we should fallback to the link method or not. |
||
48 | * |
||
49 | * @access private |
||
50 | * @since 3.0.0 |
||
51 | * @var bool |
||
52 | */ |
||
53 | private $fallback_to_link = false; |
||
54 | |||
55 | /** |
||
56 | * The Kirki_Fonts_Google object. |
||
57 | * |
||
58 | * @access protected |
||
59 | * @since 3.0.0 |
||
60 | * @var object |
||
61 | */ |
||
62 | protected $fonts_google; |
||
63 | |||
64 | |||
65 | /** |
||
66 | * The class constructor |
||
67 | * |
||
68 | * @access protected |
||
69 | * @since 3.0.0 |
||
70 | */ |
||
71 | protected function __construct() { |
||
81 | |||
82 | /** |
||
83 | * Gets an instance of this object. |
||
84 | * Prevents duplicate instances which avoid artefacts and improves performance. |
||
85 | * |
||
86 | * @static |
||
87 | * @access public |
||
88 | * @since 3.0.0 |
||
89 | * @return object |
||
90 | */ |
||
91 | public static function get_instance() { |
||
97 | |||
98 | /** |
||
99 | * Init other objects depending on the method we'll be using. |
||
100 | * |
||
101 | * @access protected |
||
102 | * @since 3.0.0 |
||
103 | */ |
||
104 | protected function init() { |
||
114 | |||
115 | /** |
||
116 | * Get the method we're going to use. |
||
117 | * |
||
118 | * @access public |
||
119 | * @since 3.0.0 |
||
120 | * @param string $config_id The config-ID. |
||
121 | * @return string |
||
122 | */ |
||
123 | public function get_method( $config_id ) { |
||
143 | |||
144 | /** |
||
145 | * Should we fallback to link method? |
||
146 | * |
||
147 | * @access protected |
||
148 | * @since 3.0.0 |
||
149 | */ |
||
150 | protected function maybe_fallback_to_link() { |
||
164 | |||
165 | /** |
||
166 | * Goes through all our fields and then populates the $this->fonts property. |
||
167 | * |
||
168 | * @access public |
||
169 | */ |
||
170 | public function loop_fields() { |
||
175 | } |
||
176 |