public function load_fonts() { if (is_ssl()) { $http = "https:"; } else { $http = "http:"; } $fonts = WPiArray::get_google_fonts(); $fontList = array(); foreach ($fonts as $font) { if (isset($font['var']) && $font['var'] != "") { $var = ":" . $font['var']; } else { $var = ""; } $fontList[] = $font['name'] . $var; } $fonts_i = implode("|", $fontList); wp_register_style("wpi_fonts", $http . "//fonts.googleapis.com/css?family=" . $fonts_i); wp_enqueue_style("wpi_fonts"); }