仅覆盖 WordPress PHP 函数的一部分
Overwriting just part of a WordPress PHP function
我正在使用 Divi WordPress 主题,它通过一个函数在他们的 core.php 文件中添加 Google 字体。
在 PHP / WordPress 中是否有一种方法可以仅覆盖部分预先存在的功能? 我想在我的子主题中添加一些内容 function.php 向 Montserrat 数组添加额外的字体粗细。
当然,我可能会覆盖整个函数,但我希望有一种方法可以只编辑 Montserrat 数组,以添加更多权重选项。
这是主题的功能,增加了一些预设的权重:
if ( ! function_exists( 'et_builder_get_google_fonts' ) ) :
function et_builder_get_google_fonts() {
$google_fonts = array(
'Abel' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Amatic SC' => array(
'styles' => '400,700',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Arimo' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Arvo' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Bevan' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Bitter' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Black Ops One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Boogaloo' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Bree Serif' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Calligraffitti' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Cantata One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Cardo' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,greek-ext,greek,latin-ext',
'type' => 'serif',
),
'Changa One' => array(
'styles' => '400,400italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Cherry Cream Soda' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Chewy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Comfortaa' => array(
'styles' => '400,300,700',
'character_set' => 'latin,cyrillic-ext,greek,latin-ext,cyrillic',
'type' => 'cursive',
),
'Coming Soon' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Covered By Your Grace' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Crafty Girls' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Crete Round' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Crimson Text' => array(
'styles' => '400,400italic,600,600italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Cuprum' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Dancing Script' => array(
'styles' => '400,700',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'cursive',
),
'Dosis' => array(
'styles' => '400,200,300,500,600,700,800',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Droid Sans' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Droid Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Francois One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Fredoka One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'The Girl Next Door' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Gloria Hallelujah' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Happy Monkey' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Indie Flower' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Josefin Slab' => array(
'styles' => '400,100,100italic,300,300italic,400italic,600,700,700italic,600italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Judson' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'serif',
),
'Kreon' => array(
'styles' => '400,300,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Lato' => array(
'styles' => '400,100,100italic,300,300italic,400italic,700,700italic,900,900italic',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Lato Light' => array(
'parent_font' => 'Lato',
'styles' => '300',
),
'Leckerli One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Lobster' => array(
'styles' => '400',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic',
'type' => 'cursive',
),
'Lobster Two' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Lora' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
'type' => 'serif',
),
'Luckiest Guy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Merriweather' => array(
'styles' => '400,300,900,700',
'character_set' => 'cyrillic,cyrillic-ext,latin,latin-ext',
'type' => 'serif',
),
'Metamorphous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Montserrat' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Noticia Text' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'serif',
),
'Nova Square' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Nunito' => array(
'styles' => '400,300,700',
'character_set' => 'vietnamese,latin,latin-ext',
'type' => 'sans-serif',
),
'Old Standard TT' => array(
'styles' => '400,400italic,700',
'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
'type' => 'serif',
),
'Open Sans' => array(
'styles' => '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
'character_set' => 'latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Open Sans Condensed' => array(
'styles' => '300,300italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,greek,vietnamese,cyrillic',
'type' => 'sans-serif',
),
'Open Sans Light' => array(
'parent_font' => 'Open Sans',
'styles' => '300',
),
'Oswald' => array(
'styles' => '400,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Pacifico' => array(
'styles' => '400',
'character_set' => 'vietnamese,latin,latin-ext',
'type' => 'cursive',
),
'Passion One' => array(
'styles' => '400,700,900',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Patrick Hand' => array(
'styles' => '400',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'cursive',
),
'Permanent Marker' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Play' => array(
'styles' => '400,700',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'Playfair Display' => array(
'styles' => '400,400italic,700,700italic,900italic,900',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'serif',
),
'Poiret One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'cursive',
),
'PT Sans' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'PT Sans Narrow' => array(
'styles' => '400,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'PT Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,cyrillic',
'type' => 'serif',
),
'Raleway' => array(
'styles' => '400,100,200,300,600,500,700,800,900',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Raleway Light' => array(
'parent_font' => 'Raleway',
'styles' => '300',
),
'Reenie Beanie' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Righteous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Roboto' => array(
'styles' => '400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese',
'type' => 'sans-serif',
),
'Roboto Condensed' => array(
'styles' => '400,300,300italic,400italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Roboto Light' => array(
'parent_font' => 'Roboto',
'styles' => '100',
),
'Rock Salt' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Rokkitt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Sanchez' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Satisfy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Schoolbell' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Shadows Into Light' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Source Sans Pro' => array(
'styles' => '400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900,900italic',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Source Sans Pro Light' => array(
'parent_font' => 'Source Sans Pro',
'styles' => '300',
),
'Special Elite' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Squada One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Tangerine' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Ubuntu' => array(
'styles' => '400,300,300italic,400italic,500,500italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'Unkempt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Vollkorn' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Walter Turncoat' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Yanone Kaffeesatz' => array(
'styles' => '400,200,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
);
return apply_filters( 'et_builder_google_fonts', $google_fonts );
}
endif;
您可以使用 'et_builder_google_fonts' 过滤器:
将此添加到您的 functions.php 以向 Tangerine 字体添加额外的粗细,例如:
add_filter('et_builder_google_fonts', 'my_custom_google_fonts', 10);
function my_custom_google_fonts($google_fonts) {
$google_fonts['Tangerine']['styles'] = '300,400,700';
return $google_fonts;
}
我正在使用 Divi WordPress 主题,它通过一个函数在他们的 core.php 文件中添加 Google 字体。
在 PHP / WordPress 中是否有一种方法可以仅覆盖部分预先存在的功能? 我想在我的子主题中添加一些内容 function.php 向 Montserrat 数组添加额外的字体粗细。
当然,我可能会覆盖整个函数,但我希望有一种方法可以只编辑 Montserrat 数组,以添加更多权重选项。
这是主题的功能,增加了一些预设的权重:
if ( ! function_exists( 'et_builder_get_google_fonts' ) ) :
function et_builder_get_google_fonts() {
$google_fonts = array(
'Abel' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Amatic SC' => array(
'styles' => '400,700',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Arimo' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Arvo' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Bevan' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Bitter' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Black Ops One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Boogaloo' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Bree Serif' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Calligraffitti' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Cantata One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Cardo' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,greek-ext,greek,latin-ext',
'type' => 'serif',
),
'Changa One' => array(
'styles' => '400,400italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Cherry Cream Soda' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Chewy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Comfortaa' => array(
'styles' => '400,300,700',
'character_set' => 'latin,cyrillic-ext,greek,latin-ext,cyrillic',
'type' => 'cursive',
),
'Coming Soon' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Covered By Your Grace' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Crafty Girls' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Crete Round' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Crimson Text' => array(
'styles' => '400,400italic,600,600italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Cuprum' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Dancing Script' => array(
'styles' => '400,700',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'cursive',
),
'Dosis' => array(
'styles' => '400,200,300,500,600,700,800',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Droid Sans' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Droid Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Francois One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Fredoka One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'The Girl Next Door' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Gloria Hallelujah' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Happy Monkey' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Indie Flower' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Josefin Slab' => array(
'styles' => '400,100,100italic,300,300italic,400italic,600,700,700italic,600italic',
'character_set' => 'latin',
'type' => 'serif',
),
'Judson' => array(
'styles' => '400,400italic,700',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'serif',
),
'Kreon' => array(
'styles' => '400,300,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Lato' => array(
'styles' => '400,100,100italic,300,300italic,400italic,700,700italic,900,900italic',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Lato Light' => array(
'parent_font' => 'Lato',
'styles' => '300',
),
'Leckerli One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Lobster' => array(
'styles' => '400',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic',
'type' => 'cursive',
),
'Lobster Two' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin',
'type' => 'cursive',
),
'Lora' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
'type' => 'serif',
),
'Luckiest Guy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Merriweather' => array(
'styles' => '400,300,900,700',
'character_set' => 'cyrillic,cyrillic-ext,latin,latin-ext',
'type' => 'serif',
),
'Metamorphous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Montserrat' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'sans-serif',
),
'Noticia Text' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'serif',
),
'Nova Square' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Nunito' => array(
'styles' => '400,300,700',
'character_set' => 'vietnamese,latin,latin-ext',
'type' => 'sans-serif',
),
'Old Standard TT' => array(
'styles' => '400,400italic,700',
'character_set' => 'cyrillic,cyrillic-ext,vietnamese,latin,latin-ext',
'type' => 'serif',
),
'Open Sans' => array(
'styles' => '300italic,400italic,600italic,700italic,800italic,400,300,600,700,800',
'character_set' => 'latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'Open Sans Condensed' => array(
'styles' => '300,300italic,700',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,greek,vietnamese,cyrillic',
'type' => 'sans-serif',
),
'Open Sans Light' => array(
'parent_font' => 'Open Sans',
'styles' => '300',
),
'Oswald' => array(
'styles' => '400,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Pacifico' => array(
'styles' => '400',
'character_set' => 'vietnamese,latin,latin-ext',
'type' => 'cursive',
),
'Passion One' => array(
'styles' => '400,700,900',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Patrick Hand' => array(
'styles' => '400',
'character_set' => 'latin,vietnamese,latin-ext',
'type' => 'cursive',
),
'Permanent Marker' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Play' => array(
'styles' => '400,700',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'Playfair Display' => array(
'styles' => '400,400italic,700,700italic,900italic,900',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'serif',
),
'Poiret One' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'cursive',
),
'PT Sans' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'PT Sans Narrow' => array(
'styles' => '400,700',
'character_set' => 'latin,latin-ext,cyrillic',
'type' => 'sans-serif',
),
'PT Serif' => array(
'styles' => '400,400italic,700,700italic',
'character_set' => 'latin,cyrillic',
'type' => 'serif',
),
'Raleway' => array(
'styles' => '400,100,200,300,600,500,700,800,900',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Raleway Light' => array(
'parent_font' => 'Raleway',
'styles' => '300',
),
'Reenie Beanie' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Righteous' => array(
'styles' => '400',
'character_set' => 'latin,latin-ext',
'type' => 'cursive',
),
'Roboto' => array(
'styles' => '400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese',
'type' => 'sans-serif',
),
'Roboto Condensed' => array(
'styles' => '400,300,300italic,400italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,latin-ext,greek-ext,cyrillic,greek,vietnamese',
'type' => 'sans-serif',
),
'Roboto Light' => array(
'parent_font' => 'Roboto',
'styles' => '100',
),
'Rock Salt' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Rokkitt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Sanchez' => array(
'styles' => '400,400italic',
'character_set' => 'latin,latin-ext',
'type' => 'serif',
),
'Satisfy' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Schoolbell' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Shadows Into Light' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Source Sans Pro' => array(
'styles' => '400,200,200italic,300,300italic,400italic,600,600italic,700,700italic,900,900italic',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
'Source Sans Pro Light' => array(
'parent_font' => 'Source Sans Pro',
'styles' => '300',
),
'Special Elite' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Squada One' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Tangerine' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Ubuntu' => array(
'styles' => '400,300,300italic,400italic,500,500italic,700,700italic',
'character_set' => 'latin,cyrillic-ext,cyrillic,greek-ext,greek,latin-ext',
'type' => 'sans-serif',
),
'Unkempt' => array(
'styles' => '400,700',
'character_set' => 'latin',
'type' => 'cursive',
),
'Vollkorn' => array(
'styles' => '400,400italic,700italic,700',
'character_set' => 'latin',
'type' => 'serif',
),
'Walter Turncoat' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'cursive',
),
'Yanone Kaffeesatz' => array(
'styles' => '400,200,300,700',
'character_set' => 'latin,latin-ext',
'type' => 'sans-serif',
),
);
return apply_filters( 'et_builder_google_fonts', $google_fonts );
}
endif;
您可以使用 'et_builder_google_fonts' 过滤器:
将此添加到您的 functions.php 以向 Tangerine 字体添加额外的粗细,例如:
add_filter('et_builder_google_fonts', 'my_custom_google_fonts', 10);
function my_custom_google_fonts($google_fonts) {
$google_fonts['Tangerine']['styles'] = '300,400,700';
return $google_fonts;
}