如果未禁用WordPress自动更新功能,那么其主题、插件、核心文件都会自动更新。更新之后都会管理员都会收到邮件通知,如果不想收到邮件通知,可以禁止。之前提到过禁用主题、插件自动更新后的邮件通知,核心文件也是可以禁用的。
禁用核心更新的自动更新通知电子邮件:
add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 ); function wpb_stop_update_emails( $send, $type, $core_update, $result ) { if ( ! empty( $type ) && $type == 'success' ) { return false; } return true; }