wc_correios_get_error_message

Get error messages.

Description

(string) wc_correios_get_error_message( (string) $code ); 

Returns (string)

Parameters (1)

0. $code (string)
Error code.

Usage

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

Defined (1)

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

/includes/wc-correios-functions.php  
  1. function wc_correios_get_error_message( $code ) { 
  2. $code = (string) $code; 
  3.  
  4. $messages = apply_filters( 'woocommerce_correios_available_error_messages', array( 
  5. '-33' => __( 'System temporarily down. Please try again later.', 'woocommerce-correios' ),  
  6. '-3' => __( 'Invalid zip code.', 'woocommerce-correios' ),  
  7. '010' => __( 'Area with delivery temporarily subjected to different periods.', 'woocommerce-correios' ),  
  8. ) ); 
  9.  
  10. return isset( $messages[ $code ] ) ? $messages[ $code ] : '';