Tắt hiển thị thông báo update plugin, theme, core Wordpress

Leave a Comment
Tắt hiển thị thông báo update core, plugin và theme cho Wordpress bạn có 2 cách làm sau:

tat hien thi thong bao update plugin theme wordpress
Tắt update cho Wordpress


Cách 1: Dùng Plugin Easy Updates Manager

Cách 2: Chèn code vào file function.php

1. Vô hiệu hóa thông báo cập nhật của WordPress:
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’ ); }
2. Vô hiệu hoá thông báo cập nhật của các Plugin trong WordPress:
remove_action ( ‘load-update-core.php’ , ‘wp_update_plugins’ ); add_filter ( ‘pre_site_transient_update_plugins’ , ‘__return_null’ );
3. Vô hiệu hoá tất cả các thông báo cập nhật trong WordPress:
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’ );
P/s: Ngoài tắt thông báo nó còn quản lý để cho phép user update hay không. Recommend nên dùng Plugin rất tiện.
Bye Bye <3
Next PostNewer Post Previous PostOlder Post Home

0 nhận xét:

Post a Comment

Powered by Blogger.