[ Index ]

PHP Cross Reference of BackPress

title

Body

[close]

/includes/ -> 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.

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

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

get_error_codes()   X-Ref
Retrieve all error codes.

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

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

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

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

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

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.

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

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

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

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

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

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

The error code can only contain one error data.

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

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.

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



Generated: Wed Dec 19 01:01:51 2018 Cross-referenced by PHPXref 0.7.1