Skip to content

Instantly share code, notes, and snippets.

@pinalj
Last active November 3, 2017 10:36
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 pinalj/b3215e63c0a2dc0d90ab3f8983c095e6 to your computer and use it in GitHub Desktop.
Save pinalj/b3215e63c0a2dc0d90ab3f8983c095e6 to your computer and use it in GitHub Desktop.
Adding multiple Notices
<?php
add_action( 'admin_notices', 'my_info_notice' );
function my_info_notice() {
?>
<div class="notice notice-info">
<p><?php _e( 'You have successfully completed the setup.', 'my-text-domain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices', 'my_error_notice' );
function my_error_notice() {
?>
<div class="notice notice-error">
<p><?php _e( 'There has been an error.', 'my-text-domain' );?></p>
</div>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment