Author fix and tag posts

This commit is contained in:
Ben Speakman 2015-04-12 18:59:03 +01:00
parent a454a10e69
commit 2b1150483e

View file

@ -33,11 +33,6 @@ class WpApi
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()
{
return $this->_get('taxonomies/category/terms');
@ -53,6 +48,16 @@ class WpApi
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)
{
return $this->_get('posts', ['page' => $page, 'filter' => ['s' => $query]]);