/** * Gets the google font url: */ function get_google_font_url() { $fonts = $this->get_set_fonts(); //get all allowed google fonts :: we need the keys to check the slug values $gfonts = cuisine_get_google_fonts(); $in_string = array(); $string = 'http://fonts.googleapis.com/css?family='; //loop through each google font to see which one to include; foreach ($gfonts as $key => $gfont) { if (in_array($gfont, $fonts)) { $string .= $key . '|'; $in_string[] = $gfont; } } $string = apply_filters('cuisine_google_font_url', $string, $in_string); //check if there are any fonts added to the html: if ($string > 'http://fonts.googleapis.com/css?family=') { return substr($string, 0, -1); } return ''; }
/** * Get available fonts * @access public * @return Array all fonts available in Cuisine. */ function cuisine_get_all_fonts() { $fonts = array_merge(cuisine_get_google_fonts(), cuisine_get_basic_fonts()); asort($fonts); return $fonts; }