wc_set_notices

Set all notices at once.

Description

wc_set_notices( $notices ); 

Parameters (1)

0. $notices
The notices.

Usage

  1. if ( !function_exists( 'wc_set_notices' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-notice-functions.php'; 
  3.  
  4. // The notices. 
  5. $notices = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_set_notices($notices); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-notice-functions.php  
  1. function wc_set_notices( $notices ) { 
  2. if ( ! did_action( 'woocommerce_init' ) ) { 
  3. wc_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before woocommerce_init.', woocommerce ), '2.6' ); 
  4. return; 
  5. WC()->session->set( 'wc_notices', $notices );