Skip to content

Instantly share code, notes, and snippets.

@nfsarmento
Last active October 30, 2018 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfsarmento/f38c18d37ea5795c6a67671879d8f60b to your computer and use it in GitHub Desktop.
Save nfsarmento/f38c18d37ea5795c6a67671879d8f60b to your computer and use it in GitHub Desktop.
Disabled admin notices wordpress
/**
* Disabled admin notices
*
* https://www.nuno-sarmento.com
*/
add_action('admin_enqueue_scripts', 'ds_admin_theme_style');
add_action('login_enqueue_scripts', 'ds_admin_theme_style');
function ds_admin_theme_style() {
if (!current_user_can( 'manage_options' )) {
echo '<style>.update-nag, .updated, .error, .is-dismissible { display: none; }</style>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment