woocommerce_add_message
The WooCommerce woocommerce add message hook.
Description
Parameters (1)
- 0. $message (unknown)
- The message.
Usage
- To run the hook, copy the example below.
- $message = apply_filters( 'woocommerce_add_message', $message );
- if ( !empty( $message ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the woocommerce_add_message callback
- function filter_woocommerce_add_message( $message ) {
- // make filter magic happen here...
- return $message;
- };
- // add the filter
- add_filter( 'woocommerce_add_message', 'filter_woocommerce_add_message', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'woocommerce_add_message', 'filter_woocommerce_add_message', 10, 1 );
Defined (2)
The filter is defined in the following location(s).
- /includes/wc-notice-functions.php
- $message = apply_filters( 'woocommerce_add_message', $message );
- $message = apply_filters( 'woocommerce_add_message', $message );