
Trong quá trình hoạt động. Sẽ có nhiều bạn muốn tắt cập nhật và thông báo cập nhật một số thành phần của WordPress (Core, Themes, Plugins) vì một số lý do nào đó. Chỉ cần bỏ đoạn code dưới đây vào function.php là mọi chuyện sẽ được giải quyết nhé.
Nếu bạn cần tắt dịch vụ update WordPress Core (phiên bản wordpress), sử dụng core sau:
/**
* Loại bỏ toàn bộ các thông báo cập nhật WordPress Core
*/
function cm_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','cm_remove_core_updates');
Nếu bạn cần tắt dịch vụ update WordPress Theme, sử dụng core sau:
/**
* Loại bỏ toàn bộ các thông báo cập nhật WordPress theme
*/
function cm_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_themes','cm_remove_core_updates');
Nếu bạn cần tắt dịch vụ update WordPress Plugin, sử dụng core sau:
/**
* Loại bỏ toàn bộ các thông báo cập nhật WordPress plugin
*/
function cm_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_plugins','cm_remove_core_updates');
Nếu bạn cần tắt tất cả dịch vụ update WordPress, sử dụng core sau:
/**
* Loại bỏ toàn bộ các thông báo cập nhật bất kể của WordPress Core, plugin hay theme
*/
function cm_remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','cm_remove_core_updates');
add_filter('pre_site_transient_update_plugins','cm_remove_core_updates');
add_filter('pre_site_transient_update_themes','cm_remove_core_updates');
Bạn nên sử dụng giao diện con child, không nên sử dụng giao diện chính vì sau khi update, function.php của giao diện chính sẽ bị ghi đè. Cách tạo child theme các bạn có thể tham khảo ở đây.
2022, aapanel, almalinux, android, apache, apple, Azure, centos, CVE, cyberpanel, cài đặt docker, directadmin, dns, docker, fastpanel, fedora, fix, install, ispconfig, lemp, linux, Log4j, macos, mariadb, microsoft, Microsoft Active Directory, modsecurity, mysql, nginx, openwrt, php, python, redis, rockylinux, security, server, theme, tplink, ubuntu, USA, user, windows, windows server, windows server 2022, wordpress