Code-Snippets-Functions/Execute a function on a child site/WordPress/hide-the-wordpress-update-notifications-for-non-admin-users.txt

6 lines
235 B
Text

function hide_core_update_notifications_from_users() {
if ( ! current_user_can( 'update_core' ) ) {
remove_action( 'admin_notices', 'update_nag', 3 );
}
}
add_action( 'admin_head', 'hide_core_update_notifications_from_users', 1 );