Kirki_Fonts::is_google_font PHP Method

is_google_font() public static method

Determine if a font-name is a valid google font or not.
public static is_google_font ( string $fontname ) : boolean
$fontname string The name of the font we want to check.
return boolean
        public static function is_google_font($fontname)
        {
            return array_key_exists($fontname, self::$google_fonts);
        }

Usage Example

Beispiel #1
0
 /**
  * Enqueue scripts js or css
  *
  * @return void
  * @access public
  */
 public function enqueueScripts()
 {
     $font = $this->getValue();
     if (\Kirki_Fonts::is_google_font($font)) {
         $font_uri = \Kirki_Fonts::get_google_font_uri(array($font));
         wp_enqueue_style('googlefonts', $font_uri);
     }
 }
All Usage Examples Of Kirki_Fonts::is_google_font