LLMS_Dot_Com_API::parse_response( array $response )
Parse the body of the response and set a success/error
Parameters Parameters
- $response
-
(array) (Required) response data
Return Return
(void)
Source Source
File: includes/class.llms.dot.com.api.php
protected function parse_response( $response ) { $body = json_decode( wp_remote_retrieve_body( $response ), true ); if ( isset( $response['response'] ) && isset( $response['response']['code'] ) && ! in_array( $response['response']['code'], array( 200, 201 ) ) ) { $msg = isset( $body['message'] ) ? $body['message'] : $response['response']['message']; $this->set_error( $msg, isset( $body['code'] ) ? $body['code'] : $response['response']['code'], $body ); } else { $this->set_result( $body ); } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.22.0 | Introduced. |