public static get_google_fonts ( ) : array | ||
return | array | All Google Fonts. |
public static function get_google_fonts()
{
if (null === self::$google_fonts || empty(self::$google_fonts)) {
$fonts = (include wp_normalize_path(Kirki::$path . '/includes/webfonts.php'));
$google_fonts = array();
if (is_array($fonts)) {
foreach ($fonts['items'] as $font) {
$google_fonts[$font['family']] = array('label' => $font['family'], 'variants' => $font['variants'], 'subsets' => $font['subsets'], 'category' => $font['category']);
}
}
self::$google_fonts = apply_filters('kirki/fonts/google_fonts', $google_fonts);
}
return self::$google_fonts;
}
/** * The class constructor. */ private function __construct() { $config = apply_filters('kirki/config', array()); // If we have set $config['disable_google_fonts'] to true then do not proceed any further. if (isset($config['disable_google_fonts']) && true === $config['disable_google_fonts']) { return; } // Populate the array of google fonts. $this->google_fonts = Kirki_Fonts::get_google_fonts(); // Enqueue link. add_action('wp_enqueue_scripts', array($this, 'enqueue'), 105); }