wordpress 文章编辑器打开速度慢的解决方法

wordpress写文章或编辑文章时,打开编辑器要等半天。但打开日志浏览页面速度又正常。记得主题functions.php中已做了谷歌字体屏蔽,日志文章页面的输出源码中是没有谷歌字体链接的。但查看文章编辑器页面源代码时,就看到有谷歌字体链接了!果然是这个谷歌字体加载搞得整个页面都慢出屎了!再次在functions.php做屏蔽编辑器中的谷歌字体代码:

// 禁用WP Editor Google字体css
function xintheme_remove_gutenberg_styles($translation, $text, $context, $domain)
{
if($context != ‘Google Font Name and Variants’ || $text != ‘Noto Serif:400,400i,700,700i’) {
return $translation;
}
return ‘off’;
}
add_filter( ‘gettext_with_context’, ‘xintheme_remove_gutenberg_styles’,10, 4);

保存后,再次打开编辑器,速度回来了!!

打赏

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注