本文整理匯總了PHP中wpgrade::get_google_font_name方法的典型用法代碼示例。如果您正苦於以下問題:PHP wpgrade::get_google_font_name方法的具體用法?PHP wpgrade::get_google_font_name怎麽用?PHP wpgrade::get_google_font_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wpgrade
的用法示例。
在下文中一共展示了wpgrade::get_google_font_name方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wpgrade_callback_load_google_fonts_api_rosa
function wpgrade_callback_load_google_fonts_api_rosa()
{
$fonts_array = array('google_titles_font', 'google_subtitles_font', 'google_nav_font', 'google_body_font');
$families = array();
foreach ($fonts_array as $font) {
$clean_font = wpgrade::get_google_font_name($font);
if (!empty($clean_font)) {
$families[] = $clean_font;
}
}
$families = apply_filters('wpgrade_google_fonts', $families);
if (!empty($families) || is_preview()) {
//only enqueue the api is we actually have webfonts
wp_enqueue_script('webfont-script');
}
}
示例2: wpgrade_callback_load_google_fonts
function wpgrade_callback_load_google_fonts()
{
if (wpgrade::option('use_google_fonts')) {
$fonts_array = array('google_titles_font', 'google_second_font', 'google_nav_font', 'google_body_font');
$families = array();
foreach ($fonts_array as $font) {
$clean_font = wpgrade::get_google_font_name($font);
if (!empty($clean_font)) {
$families[] = $clean_font;
}
}
if (!empty($families)) {
// any variables in scope will be available in the partial
include wpgrade::themefilepath('wpgrade-core/resources/views/google-fonts-script' . EXT);
}
}
}