Skip to content

Instantly share code, notes, and snippets.

@desrosj
Last active November 15, 2018 02:12
Show Gist options
  • Save desrosj/224863d7fb9fa9f4866ac5b2f6e15ebc to your computer and use it in GitHub Desktop.
Save desrosj/224863d7fb9fa9f4866ac5b2f6e15ebc to your computer and use it in GitHub Desktop.
<?php
function demo_notice_add() {
?>
<div class="notice"><p>This is a notice without a type.</p></div>
<div class="notice is-dismissible"><p>This is a dismissible notice without a type.</p></div>
<div class="updated"><p>Your action succeeded!</p><p><a href="" class="button">Test Button</a></p></div>
<div class="error"><p>My error notice text1</p></div>
<div class="notice notice-success is-dismissible"><p>My dismissible success notice text</p></div>
<div class="notice notice-alt notice-success"><p>My alt success notice text</p></div>
<div class="notice notice-alt notice-success is-dismissible"><p>My dismissible alt success notice text</p></div>
<div class="notice notice-warning is-dismissible"><p>My dismissible warning notice text</p></div>
<div class="notice notice-warning"><p>My warning notice text</p></div>
<div class="notice notice-alt notice-warning is-dismissible"><p>My dismissible alt warning notice text</p></div>
<div class="notice notice-alt notice-warning"><p>My alt warning notice text</p></div>
<div class="notice notice-info is-dismissible"><p>My dismissible info notice text</p></div>
<div class="notice notice-info"><p>My info notice text</p></div>
<div class="notice notice-alt notice-info is-dismissible"><p>My dismissible alt info notice text</p></div>
<div class="notice notice-alt notice-info"><p>My alt info notice text</p></div>
<div class="notice notice-error is-dismissible"><p>My dismissible error notice text</p></div>
<div class="notice notice-error"><p>My error notice text</p></div>
<div class="notice notice-alt notice-error is-dismissible"><p>My dismissible alt error notice text</p></div>
<div class="notice notice-alt notice-error"><p>My alt error notice text</p></div>
<div class="notice notice-success"><p class="notice-title">This is a notice title</p></div>
<div class="notice notice-large notice-success"><p>This is a notice title</p></div>
<div class="notice update-message notice-error"><p>This is an error notice with an icon.</p></div>
<div class="notice updated-message notice-success"><p>This is a success notice with an icon.</p></div>
<?php
}
add_action( 'admin_notices', 'demo_notice_add' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment