php 将字体添加到内容编辑器css

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 将字体添加到内容编辑器css相关的知识,希望对你有一定的参考价值。

//add font to wigiy editor
add_editor_style( '/css/editor.css' );
add_filter( 'tiny_mce_before_init', 'wpex_mce_google_fonts_array' );
function wpex_mce_google_fonts_array( $initArray ) {
    $theme_advanced_fonts = 'futura=futura;';
    $theme_advanced_fonts .= 'futura_b=futura_b;';
    $theme_advanced_fonts .= 'avenir_Bold=avenir_b;';
    $theme_advanced_fonts .= 'avenir_Regular=avenir_r';
    $initArray['font_formats'] = $theme_advanced_fonts;
    return $initArray;
}

以上是关于php 将字体添加到内容编辑器css的主要内容,如果未能解决你的问题,请参考以下文章