wordpress show notice

Solutions on MaxInterview for wordpress show notice by the best coders in the world

showing results for - "wordpress show notice"
Lyna
22 Jul 2020
1// for success
2<div class="notice notice-success is-dismissible">
3        <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
4</div>
5  
6// for error  
7<div class="notice notice-error is-dismissible ">
8        <p><?php _e( 'Error message here!', 'sample-text-domain' ); ?></p>
9</div>
10  
Alexander
03 Aug 2016
1function sample_admin_notice__success() {
2    ?>
3    <div class="notice notice-success is-dismissible">
4        <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
5    </div>
6    <?php
7}
8add_action( 'admin_notices', 'sample_admin_notice__success' );
9