Outputs an admin notice.
$messagestringrequired
$argsarrayoptional
type string'error', 'success', 'warning', 'info'.dismissible boolid stringadditional_classes string[]attributes string[]paragraph_wrap boolDefault:array()
function wp_admin_notice( $message, $args = array() ) {
/**
* Fires before an admin notice is output.
*
* @since 6.4.0
*
* @param string $message The message for the admin notice.
* @param array $args The arguments for the admin notice.
*/
do_action( 'wp_admin_notice', $message, $args );
echo wp_kses_post( wp_get_admin_notice( $message, $args ) );
}
Fires before an admin notice is output.
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_admin_notice