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())
|
public function _get($method, array $query = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
$client = new Client();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$response = $client->get($this->endpoint . '/wp-json/' . $method, ['query' => $query]);
|
$response = $this->client->get($this->endpoint . '/wp-json/' . $method, ['query' => $query]);
|
||||||
|
|
||||||
$return = [
|
$return = [
|
||||||
'results' => $response->json(),
|
'results' => $response->json(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue