Codex

Plugin API/Action Reference/admin notices

This page is marked as incomplete. You can help Codex by expanding it.

Description

Notices displayed near the top of admin pages. The hook function should echo a message to be displayed.

Example

function my_admin_notice() {
    ?>
    <div class="updated">
        <p><?php _e( 'Updated!', 'my-text-domain' ); ?></p>
    </div>
    <?php
}
add_action( 'admin_notices', 'my_admin_notice' );

The class "updated" will display the message with a yellow background.

The class "error" will display the message with a red background.

Related