Answers for "wordpress show notice"

PHP
1

wordpress notice

// for success
<div class="notice notice-success is-dismissible">
        <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
</div>
  
// for error  
<div class="notice notice-error is-dismissible ">
        <p><?php _e( 'Error message here!', 'sample-text-domain' ); ?></p>
</div>
Posted by: Guest on July-07-2021
1

wordpress show notice

function sample_admin_notice__success() {
    ?>
    <div class="notice notice-success is-dismissible">
        <p><?php _e( 'Done!', 'sample-text-domain' ); ?></p>
    </div>
    <?php
}
add_action( 'admin_notices', 'sample_admin_notice__success' );
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language