woocommerce_add_message
Print a single notice immediately.
Usage
add_filter( 'woocommerce_add_message', 'wp_kama_woocommerce_add_message_filter' );
/**
* Function for `woocommerce_add_message` filter-hook.
*
* @param string $message The text to display in the notice.
*
* @return string
*/
function wp_kama_woocommerce_add_message_filter( $message ){
// filter...
return $message;
}
- $message(string)
- The text to display in the notice.
Changelog
| Since 2.1 | Introduced. |
Where the hook is called
woocommerce_add_message
woocommerce_add_message
woocommerce/includes/wc-notice-functions.php 203
$message = apply_filters( 'woocommerce_add_message', $message );
woocommerce/includes/wc-notice-functions.php 93
$message = apply_filters( 'woocommerce_add_message', $message );