Author fix and tag posts
This commit is contained in:
parent
a454a10e69
commit
2b1150483e
|
|
@ -33,11 +33,6 @@ class WpApi
|
||||||
return $this->_get('posts', ['type' => 'page', 'filter' => ['name' => $slug]]);
|
return $this->_get('posts', ['type' => 'page', 'filter' => ['name' => $slug]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function author($name)
|
|
||||||
{
|
|
||||||
return $this->_get('posts', ['type' => 'page', 'filter' => ['author_name' => $name]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function categories()
|
public function categories()
|
||||||
{
|
{
|
||||||
return $this->_get('taxonomies/category/terms');
|
return $this->_get('taxonomies/category/terms');
|
||||||
|
|
@ -53,6 +48,16 @@ class WpApi
|
||||||
return $this->_get('posts', ['page' => $page, 'filter' => ['category_name' => $slug]]);
|
return $this->_get('posts', ['page' => $page, 'filter' => ['category_name' => $slug]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function author_posts($name, $page = null)
|
||||||
|
{
|
||||||
|
return $this->_get('posts', ['page' => $page, 'filter' => ['author_name' => $name]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function tag_posts($tags, $page = null)
|
||||||
|
{
|
||||||
|
return $this->_get('posts', ['page' => $page, 'filter' => ['tag' => $tags]]);
|
||||||
|
}
|
||||||
|
|
||||||
public function search($query, $page = null)
|
public function search($query, $page = null)
|
||||||
{
|
{
|
||||||
return $this->_get('posts', ['page' => $page, 'filter' => ['s' => $query]]);
|
return $this->_get('posts', ['page' => $page, 'filter' => ['s' => $query]]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue