Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>
  
Comment

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' );
Comment

wordpress notice

# More advance version

function sample_admin_notice__error() {
    $class = 'notice notice-error';
    $message = __( 'Irks! An error has occurred.', 'sample-text-domain' );
 
    printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) ); 
}
add_action( 'admin_notices', 'sample_admin_notice__error' );
Comment

PREVIOUS NEXT
Code Example
Php :: continue php 
Php :: woocommerce product object 
Php :: Fatal error: Cannot redeclare 
Php :: check if user has role twig 
Php :: replace accent php 
Php :: query-data-from mysql and php 
Php :: laravel link active class 
Php :: add user meta 
Php :: remove array element php 
Php :: laravel api enable cors 
Php :: laravel get current action name 
Php :: php convert array to number 
Php :: php ternary operator 
Php :: laravel form validation 
Php :: php append to csv 
Php :: laravel with has 
Php :: root directory in php 
Php :: laravel run seeder enter timestamps 
Php :: carbon difference between two dates 
Php :: ajax post example php 
Php :: wordpress get template directory 
Php :: php qrscanner webcam 
Php :: How to get a substring between two strings in PHP? 
Php :: php sort array by specific key 
Php :: how to use where relationship laravel 
Php :: csrf token mismatch laravel api 
Php :: php file upload error 
Php :: get slogan wp 
Php :: laravel group route controller 
Php :: php zeilenumbruch 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =