You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awesome plugin! Is it possible to get the API results after calling the URL? I tried var dumping the class but there is no info about the original response request.
I need that to show the customer an error that the updater API may return (like no plugin found / license not valid).
The text was updated successfully, but these errors were encountered:
There are several ways you could do that. One option would be to use the $prefix_request_metadata_http_result-$slug filter. For example:
$updateChecker->addFilter('request_metadata_http_result', function($httpResponse) {
//Do something with $httpResponse here. It's the value returned by wp_remote_get().//Remember to return the response.return$httpResponse;
});
The actual filter name changed depending on the plugin/theme, so I'm using the addFilter() method for convenience. If necessary, you do something like this instead:
Alternatively, the $prefix_request_info_result-$slug filter is also an option. It is called after the plugin metadata has already been parsed.
$updateChecker->addFilter('request_info_result', function($pluginInfo, $httpResponse) {
//$pluginInfo is an object that pretty much maps directly to the contents of the API response.return$pluginInfo;
}, 10, 2);
Hi there,
awesome plugin! Is it possible to get the API results after calling the URL? I tried var dumping the class but there is no info about the original response request.
I need that to show the customer an error that the updater API may return (like no plugin found / license not valid).
The text was updated successfully, but these errors were encountered: