Tắt thông báo các cập nhật trong wordpress

Vô hiệu hóa thông báo cập nhật cho WordPress bằng cú pháp can thiệp vào theme
Tắt thông báo cập nhật WordPress
Chèn đoạn mã dưới đây vào tệp functions.php của chủ đề đang hoạt động của bạn. Nó sẽ loại bỏ các cảnh báo cập nhật phiên bản WordPress, từ toàn bộ bảng điều khiển của người dùng, trang tổng quan của quản trị viên và từ trang Cập nhật.

add_action(‘after_setup_theme’,’remove_core_updates’);
function remove_core_updates()
{
if(! current_user_can(‘update_core’)){return;}
add_action(‘init’, create_function(‘$a’,”remove_action( ‘init’, ‘wp_version_check’ );”),2);
add_filter(‘pre_option_update_core’,’__return_null’);
add_filter(‘pre_site_transient_update_core’,’__return_null’);
}
——————————————————–
Vô hiệu hóa các thông báo cập nhật Plugin
Chèn đoạn mã dưới đây vào tệp functions.php của chủ đề đang hoạt động của bạn. Nó sẽ loại bỏ các thông báo cập nhật của tất cả các plugin được cài đặt.

/*
* Disable Plugin Update Notifications
*/
remove_action(‘load-update-core.php’,’wp_update_plugins’);
add_filter(‘pre_site_transient_update_plugins’,’__return_null’);
—————————————————–
Vô hiệu hóa các thông báo cập nhật Chủ đề

Chèn đoạn mã dưới đây vào tệp functions.php của chủ đề đang hoạt động của bạn. Nó sẽ loại bỏ các thông báo cập nhật của tất cả các chủ đề được cài đặt.
/*
 * Disable Theme Update Notifications
 */
remove_action(‘load-update-core.php’,’wp_update_themes’);
add_filter(‘pre_site_transient_update_themes’,’__return_null’);

Vô hiệu hóa tất cả các thông báo cập nhật
Chèn đoạn mã dưới đây vào tệp functions.php của chủ đề đang hoạt động của bạn. Đoạn mã này vô hiệu hóa tất cả các thông báo cập nhật liên quan đến plugin, chủ đề & WordPress core.
/*
 * Disable All Notifications
 */
function remove_core_updates(){
global $wp_version;return(object) array(‘last_checked’=> time(),’version_checked’=> $wp_version,);
}
add_filter(‘pre_site_transient_update_core’,’remove_core_updates’);
add_filter(‘pre_site_transient_update_plugins’,’remove_core_updates’);
add_filter(‘pre_site_transient_update_themes’,’remove_core_updates’);

Leave a Reply

Your email address will not be published. Required fields are marked *