📅  最后修改于: 2022-03-11 14:54:23.726000             🧑  作者: Mango
# More advance version
function sample_admin_notice__error() {
$class = 'notice notice-error';
$message = __( 'Irks! An error has occurred.', 'sample-text-domain' );
printf( '%2$s
', esc_attr( $class ), esc_html( $message ) );
}
add_action( 'admin_notices', 'sample_admin_notice__error' );