Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Endpoint/AbstractWpEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(WpClient $client)
$this->client = $client;
}

abstract protected function getEndpoint();
abstract protected function getEndpoint($path = '');

/**
* @param int $id
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Categories extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/categories';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Comments extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/comments';
}
Expand Down
19 changes: 19 additions & 0 deletions src/Endpoint/Custom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Vnn\WpApiClient\Endpoint;

/**
* Class Comments
* @package Vnn\WpApiClient\Endpoint
*/
class Custom extends AbstractWpEndpoint{

/**
* @param $endpoint - Custom endpoint for REST API route. e.g. /acf/v3/
*
*/
protected function getEndpoint($path = '')
{
return '/wp-json' . $path;
}
}
2 changes: 1 addition & 1 deletion src/Endpoint/FakeEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class FakeEndpoint extends AbstractWpEndpoint
{
public function getEndpoint()
public function getEndpoint($path = '')
{
return '/foo';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Media extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/media';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Pages extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/pages';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/PostStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PostStatuses extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/statuses';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/PostTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PostTypes extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/types';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Posts extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/posts';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Tags extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/tags';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoint/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Users extends AbstractWpEndpoint
/**
* {@inheritdoc}
*/
protected function getEndpoint()
protected function getEndpoint($path = '')
{
return '/wp-json/wp/v2/users';
}
Expand Down