Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_AssetCache::generate_font_imports()
Generate Popup Theme Styles
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Return Return
(mixed|string)
Source Source
File: classes/AssetCache.php
public static function generate_font_imports() { $imports = ''; $google_fonts = array(); foreach ( pum_get_all_themes() as $theme ) { $google_fonts = array_merge( $google_fonts, pum_get_theme( $theme->ID )->get_google_fonts_used() ); } if ( ! empty( $google_fonts ) && ! pum_get_option( 'disable_google_font_loading', false ) ) { $link = "//fonts.googleapis.com/css?family="; foreach ( $google_fonts as $font_family => $variants ) { if ( $link != "//fonts.googleapis.com/css?family=" ) { $link .= "|"; } $link .= $font_family; if ( is_array( $variants ) ) { if ( implode( ',', $variants ) != '' ) { $link .= ":"; $link .= trim( implode( ',', $variants ), ':' ); } } } $imports = "/* Popup Google Fonts */\r\n@import url('$link');\r\n\r\n" . $imports; } $imports = apply_filters( 'pum_generate_font_imports', $imports ); return $imports; }
Expand full source code Collapse full source code View on Trac