解决方法:1.插件 2.代码
插件:Disable Google Fonts、Remove Open Sans font Link from WP core(这两个都是直接禁用);DW Replace Open Sans(更改cdn节点)
_ueditor_page_break_tag_
代码:添加下面的代码到当前所用的主题的 functions.php 中即可:
完全屏蔽:
function remove_open_sans() { wp_deregister_style( 'open-sans' ); wp_register_style( 'open-sans', false ); wp_enqueue_style('open-sans',''); } add_action( 'init', 'remove_open_sans' );
或
add_filter( 'gettext_with_context', 'wpdx_disable_open_sans', 888, 4 );function wpdx_disable_open_sans( $translations, $text, $context, $domain ) { if ( 'Open Sans font: on or off' == $context && 'on' == $text ) { $translations = 'off'; } return $translations;}
替代方案:
function devework_replace_open_sans() { wp_deregister_style('open-sans'); wp_register_style( 'open-sans', '//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600' ); wp_enqueue_style( 'open-sans');}add_action( 'wp_enqueue_scripts', 'devework_replace_open_sans' );add_action('admin_enqueue_scripts', 'devework_replace_open_sans');
或(推荐)
function wpdx_replace_open_sans() { wp_deregister_style('open-sans'); wp_register_style( 'open-sans', '//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600' ); if(is_admin()) wp_enqueue_style( 'open-sans');}add_action( 'init', 'wpdx_replace_open_sans' );