Error Logger
Object trait is located in eightshift Libs
. To extend it, use eightshift_Libs\Helpers\Error_Logger
class.
If you are working with Ajax or REST API in your project, this logger will come in handy. We have created this simple trait helper that you can use in any PHP class as a trait.
rest_response_handler
Ensure correct response for rest using the handler function.
-
@param integer $code Response Status code.
-
@param string $status Response Status name. (success/error).
-
@param string|null $msg Response Message.
-
@param array|null $data Response additional data.
-
@return \WP_Error|array \WP_Error instance with error message and status or array.