Title: Filter parameter
Last modified: August 21, 2016

---

# Filter parameter

 *  Resolved [thonyfd](https://wordpress.org/support/users/thonyfd/)
 * (@thonyfd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/filter-parameter/)
 * _[Moderator note: Topic title de-capped. Please do not shout at us.]_
 * Hi all, i have a few days trying to use the filter parameter, but i don’t have
   idea how to send the filter information.
 * Do you have an example or most detailed documentation for this functionality?
 * Your plugin is great! but i have short rest experience.
 * Best regards!
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [thonyfd](https://wordpress.org/support/users/thonyfd/)
 * (@thonyfd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/filter-parameter/#post-4585855)
 * Hi Guys,sorry for the title.
 * About my problem i added this lines in “class-wp-json-posts.php”
 * if(isset($filter) && $filter !==”){
    $filter = json_decode(stripslashes($filter),
   true); }
 * and i’m using an angularjs ajax method like this
 * var filter = {};
    filter[‘posts_per_page’] = 5; filter[‘post_type’] = ‘Post’;
   filter[‘cat’] = 5;
 * $http.get(‘[http://myhost/wp-json.php/posts&#8217](http://myhost/wp-json.php/posts&#8217);,{
   params: {“filter”: JSON.stringify(filter)}}).success(function(data) {
    //something
   here });
 * this it solve my problem but, is there a better way to use the filter parameter?
 * thank’s for all, and sorry again .
 *  Thread Starter [thonyfd](https://wordpress.org/support/users/thonyfd/)
 * (@thonyfd)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/filter-parameter/#post-4585856)
 * I find my answer in this post jeje
 * [http://wordpress.org/support/topic/passing-filters?replies=7](http://wordpress.org/support/topic/passing-filters?replies=7)
 * Best Regards!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter parameter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [parameter](https://wordpress.org/support/topic-tag/parameter/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 2 replies
 * 1 participant
 * Last reply from: [thonyfd](https://wordpress.org/support/users/thonyfd/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/filter-parameter/#post-4585856)
 * Status: resolved