Use injected Guzzle client
This commit is contained in:
parent
3b668336f0
commit
91499b734a
|
|
@ -56,11 +56,9 @@ class WpApi
|
|||
public function _get($method, array $query = array())
|
||||
{
|
||||
|
||||
$client = new Client();
|
||||
|
||||
try {
|
||||
|
||||
$response = $client->get($this->endpoint . '/wp-json/' . $method, ['query' => $query]);
|
||||
$response = $this->client->get($this->endpoint . '/wp-json/' . $method, ['query' => $query]);
|
||||
|
||||
$return = [
|
||||
'results' => $response->json(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue