[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-forums/bbpress/bb-includes/backpress/ -> class.wp-error.php (summary)

(no description)

File Size: 208 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Error:: (10 methods):
  __construct()
  WP_Error()
  get_error_codes()
  get_error_code()
  get_error_messages()
  get_error_message()
  get_error_data()
  add()
  add_data()
  is_wp_error()


Class: WP_Error  - X-Ref

WordPress Error class.

Container for checking for WordPress errors and error messages. Return
WP_Error and use {@link is_wp_error()} to check if this class is returned.
Many core WordPress functions pass this class in the event of an error and
if not handled properly will result in code errors.

__construct($code = '', $message = '', $data = '')   X-Ref
PHP4 Constructor - Sets up error message.

If code parameter is empty then nothing will be done. It is possible to
add multiple messages to the same code, but with other methods in the
class.

All parameters are optional, but if the code parameter is set, then the
data parameter is optional.

return: WP_Error
param: string|int $code Error code
param: string $message Error message
param: mixed $data Optional. Error data.
since: 2.1.0

WP_Error($code = '', $message = '', $data = '')   X-Ref
No description

get_error_codes()   X-Ref
Retrieve all error codes.

return: array List of error codes, if avaiable.
since: 2.1.0

get_error_code()   X-Ref
Retrieve first error code available.

return: string|int Empty string, if no error codes.
since: 2.1.0

get_error_messages($code = '')   X-Ref
Retrieve all error messages or error messages matching code.

return: array Error strings on success, or empty array on failure (if using codee parameter).
param: string|int $code Optional. Retrieve messages matching code, if exists.
since: 2.1.0

get_error_message($code = '')   X-Ref
Get single error message.

This will get the first message available for the code. If no code is
given then the first code available will be used.

return: string
param: string|int $code Optional. Error code to retrieve message.
since: 2.1.0

get_error_data($code = '')   X-Ref
Retrieve error data for error code.

return: mixed Null, if no errors.
param: string|int $code Optional. Error code.
since: 2.1.0

add($code, $message, $data = '')   X-Ref
Append more error messages to list of error messages.

param: string|int $code Error code.
param: string $message Error message.
param: mixed $data Optional. Error data.
since: 2.1.0

add_data($data, $code = '')   X-Ref
Add data for error code.

The error code can only contain one error data.

param: mixed $data Error data.
param: string|int $code Error code.
since: 2.1.0

is_wp_error($thing)   X-Ref
Check whether variable is a WordPress Error.

Looks at the object and if a WP_Error class. Does not check to see if the
parent is also WP_Error, so can't inherit WP_Error and still use this
function.

return: bool True, if WP_Error. False, if not WP_Error.
param: mixed $thing Check if unknown variable is WordPress Error object.
since: 2.1.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1