本文整理汇总了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);
}
}
}