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:
David Anderson 2017-07-17 14:12:39 +00:00 committed by GitHub
parent 8e4959a17b
commit ef91a9409d
1 changed files with 3 additions and 1 deletions

View File

@ -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;