Make wp_remote_get result filterable
I want to filter the wp_remote_get result. In my use-case, if https fails, I switch back to http (in case the user had a bad curl setup/obsolete SSL certificates) and try again. Until now I've been patching the code, but that is, of course, silly!
This commit is contained in:
parent
8e4959a17b
commit
ef91a9409d
|
|
@ -460,6 +460,8 @@ if ( !class_exists('Puc_v4p1_UpdateChecker', false) ):
|
|||
|
||||
$result = wp_remote_get($url, $options);
|
||||
|
||||
$result = apply_filters($this->getUniqueName('http_result'), $result, $url, $options);
|
||||
|
||||
//Try to parse the response
|
||||
$status = $this->validateApiResponse($result);
|
||||
$metadata = null;
|
||||
|
|
@ -822,4 +824,4 @@ if ( !class_exists('Puc_v4p1_UpdateChecker', false) ):
|
|||
|
||||
}
|
||||
|
||||
endif;
|
||||
endif;
|
||||
|
|
|
|||
Loading…
Reference in New Issue