WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
__construct ($code, $type=WPDKResultType::STATUS, $message= '', $data= '') | |
Construct. More... | |
display ($echo=true, $log=null) | |
Display ot return output. More... | |
getVarDump ($content) | |
Do a var_dump. More... | |
Static Public Member Functions | |
static | isError ($thing) |
Check whether variable is a WPDK result error. More... | |
static | isWarning ($thing) |
Check whether variable is a WPDK result warning. More... | |
static | isStatus ($thing) |
Check whether variable is a WPDK result status. More... | |
Protected Member Functions | |
sanitizeCode ($code) | |
Sanitize code id. More... | |
Static Protected Member Functions | |
static | _is ($thing, $class= 'WPDKError') |
Generic object compare. More... | |
The WPDKResult is an extension of WP_Error class. This class is used for subclass the three state of WPDK result. You rarely instance this class directly. The WPDK provides three classes for manage error, warning and status information feedback. Please check in wpdk-functions.php for is_wpdk_error()
too.
Definition at line 31 of file wpdk-result.php.
__construct | ( | $code, | |
$type = WPDKResultType::STATUS , |
|||
$message = '' , |
|||
$data = '' |
|||
) |
Construct.
Create an instance of WPDKError class
string | $code | A lowercase string code id, ie. wpxcf_no_user_found |
string | $type | A WPDKResultType, default WPDKResultType::STATUS |
string | $message | Error message |
mixed | $data | Optional. Error data. |
Definition at line 45 of file wpdk-result.php.
|
staticprotected |
Generic object compare.
Return true if $thing is an object of $class class name
mixed | $thing | Check if unknown variable is WPDKError object. |
string | $class | Class name |
Definition at line 145 of file wpdk-result.php.
display | ( | $echo = true , |
|
$log = null |
|||
) |
Display ot return output.
Display or return a formatted output for WP_Error object. For each error in WP_Error object a formatted output is done with code error and error data.
bool | $echo | TRUE to display or FALSE to get output |
WPDKWatchDog | $log | A WPDKWatchDog object to log the display |
Definition at line 63 of file wpdk-result.php.
getVarDump | ( | $content | ) |
Do a var_dump.
Return the var_dump of mixed input
mixed | $content | Mixed variable to grab |
Definition at line 105 of file wpdk-result.php.
|
static |
Check whether variable is a WPDK result error.
Looks at the object and if a WPDKError class. Does not check to see if the parent is also WPDKError or a WPDKResult, so can't inherit both the classes and still use this function.
mixed | $thing | Check if unknown variable is WPDKError object. |
Definition at line 164 of file wpdk-result.php.
|
static |
Check whether variable is a WPDK result status.
Looks at the object and if a WPDKStatus class. Does not check to see if the parent is also WPDKStatus or a WPDKResult, so can't inherit both the classes and still use this function.
mixed | $thing | Check if unknown variable is WPDKStatus object. |
Definition at line 196 of file wpdk-result.php.
|
static |
Check whether variable is a WPDK result warning.
Looks at the object and if a WPDKWarning class. Does not check to see if the parent is also WPDKWarning or a WPDKResult, so can't inherit both the classes and still use this function.
mixed | $thing | Check if unknown variable is WPDKWarning object. |
Definition at line 180 of file wpdk-result.php.
|
protected |
Sanitize code id.
The code must be a lowercase string with underscore separation.
string | $code |
Definition at line 124 of file wpdk-result.php.