Skip to content

Instantly share code, notes, and snippets.

@grola
Created January 15, 2019 12:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Dismissible notice
<?php
function wpdesk_dismisible_info_notice_for_administrator() {
$user = wp_get current_user();
if ( in_array( 'administrator', $user->roles ) ) {
?>
<div class="notice notice-info is-dismissible">
<p>Info notice for administrator.</p>
</div>
<?php
}
}
add_action( 'admin notices', 'wpdesk_dismisible_info_notice_for_administrator' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment