wc_add_wp_error_notices

Add notices for WP Errors.

Description

wc_add_wp_error_notices( (WP_Error) $errors ); 

Parameters (1)

0. $errors (WP_Error)
The errors.

Usage

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

Defined (1)

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

/includes/wc-notice-functions.php  
  1. function wc_add_wp_error_notices( $errors ) { 
  2. if ( is_wp_error( $errors ) && $errors->get_error_messages() ) { 
  3. foreach ( $errors->get_error_messages() as $error ) { 
  4. wc_add_notice( $error, error );