bbp_add_error

Adds an error message to later be output in the theme.

Description

bbp_add_error( (string) $code = '', (string) $message = '', (string) $data = '' ); 

Parameters (3)

0. $code — Optional. (string) => ''
Unique code for the error message
1. $message — Optional. (string) => ''
Translated error message
2. $data — Optional. (string) => ''
Any additional data passed with the error message

Usage

  1. if ( !function_exists( 'bbp_add_error' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/core/functions.php'; 
  3.  
  4. // Unique code for the error message 
  5. $code = ''; 
  6.  
  7. // Translated error message 
  8. $message = ''; 
  9.  
  10. // Any additional data passed with the error message 
  11. $data = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bbp_add_error($code, $message, $data); 
  15.  

Defined (1)

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

/includes/core/functions.php  
  1. function bbp_add_error( $code = '', $message = '', $data = '' ) { 
  2. bbpress)->errors->add( $code, $message, $data );