谷歌被墙之后WordPress内部字体导致网页加载速度慢的解决方法

function remove_wp_open_sans() { ? wp_deregister_style('open-sans'); ? wp_register_style('open-sans',false); ? wp_enqueue_style('open-sans',''); } add_action('wp_enqueue_scripts', 'remove_wp_open_sans');  //禁用Googlefont class Disable_Google_Fonts { ??????? public function __construct() { ??????????????? add_filter( 'gettext_with_context', array( $this, 'disable_open_sans'???????????? ), 888, 4 ); ??????? } ??????? public function disable_open_sans( $translations, $text, $context, $domain ) { ??????????????? if ( 'Open Sans font: on or off' == $context && 'on' == $text ) { ??????????????????????? $translations = 'off'; ??????????????? } ??????????????? return $translations; ??????? } } $disable_google_fonts = new Disable_Google_Fonts;

0

评论0

请先

没有账号? 注册  忘记密码?

社交账号快速登录