到WordPress后台→外观→主题编辑器中。找到主题文件,将下面代码添加到主题function.php文件中:此步骤目的为禁用一些 API 的自动更新任务和关闭谷歌字体。如下图所示:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
add_filter('automatic_updater_disabled','__return_true');
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'; }
remove_action('init', 'wp_schedule_update_checks');
wp_clear_scheduled_hook('wp_version_check');
wp_clear_scheduled_hook('wp_update_plugins');
wp_clear_scheduled_hook('wp_update_themes');
wp_clear_scheduled_hook('wp_maybe_auto_update');
remove_action('admin_init','_maybe_update_core');
remove_action( 'load-plugins.php', 'wp_update_plugins'); remove_action( 'load-update.php', 'wp_update_plugins'); remove_action( 'load-update-core.php', 'wp_update_plugins'); remove_action('admin_init','_maybe_update_plugins');
remove_action( 'load-themes.php','wp_update_themes'); remove_action( 'load-update.php','wp_update_themes'); remove_action( 'load-update-core.php', 'wp_update_themes'); remove_action( 'admin_init','_maybe_update_themes');
|