Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
Adding support for user endpoint. Fixed issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan van Rooij committed May 8, 2017
1 parent 13482fa commit 4a2fc60
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
**Donate link:** https://svrooij.nl/buy-me-a-beer
**Tags:** json, rest, api, rest-api
**Requires at least:** 4.4
**Tested up to:** 4.7.3
**Stable tag:** 1.0.6
**Tested up to:** 4.7.4
**Stable tag:** 1.0.7
**License:** MIT
**License URI:** https://raw.githubusercontent.com/svrooij/rest-api-filter-fields/master/LICENSE

Expand Down Expand Up @@ -89,14 +89,19 @@ You can filter on nested properties with a '.' like 'title.rendered'. Not sure i
Yes, we picked 20 as priority (default = 10) for activating.
This mean this plugin is probably activated last, so all custom post types should already be loaded.
But this only works if you made it public for the api.
See [Adding REST API Support for Custom Content Types](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/) for more information.

### I found a bug, what should I do? ###

All the bugs/issues are maintained on [github.com/svrooij/rest-api-filter-fields](https://github.com/svrooij/rest-api-filter-fields/issues)
so please create an issue (or a pull request with a fix there)
so please create an issue (or a pull request with a fix) there.

## Changelog ##

### 1.0.7 ###
* Filter fields enabled on users [Issue #9](https://github.com/svrooij/rest-api-filter-fields/issues/9)
* Bumped wordpress version

### 1.0.6 ###
* Filter fields enabled on custom taxonomies [Issue #6](https://github.com/svrooij/rest-api-filter-fields/issues/6), thanks to [Denis Yilmaz](https://github.com/denisyilmaz) for the fix!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ public function init(){

}

// Also enable filtering 'categories', 'comments', 'taxonomies' and 'terms'
// Also enable filtering 'categories', 'comments', 'taxonomies', 'terms' and 'users'
add_filter('rest_prepare_comment',array($this,'filter_magic'),20,3);
add_filter('rest_prepare_taxonomy',array($this,'filter_magic'),20,3);
add_filter('rest_prepare_term',array($this,'filter_magic'),20,3);
add_filter('rest_prepare_category',array($this,'filter_magic'),20,3);
add_filter('rest_prepare_user',array($this,'filter_magic'),20,3);
}


Expand Down
11 changes: 8 additions & 3 deletions rest-api-filter-fields/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: svrooij
Donate link: https://svrooij.nl/buy-me-a-beer
Tags: json, rest, api, rest-api
Requires at least: 4.4
Tested up to: 4.7.3
Stable tag: 1.0.6
Tested up to: 4.7.4
Stable tag: 1.0.7
License: MIT
License URI: https://raw.githubusercontent.com/svrooij/rest-api-filter-fields/master/LICENSE

Expand Down Expand Up @@ -89,14 +89,19 @@ You can filter on nested properties with a '.' like 'title.rendered'. Not sure i
Yes, we picked 20 as priority (default = 10) for activating.
This mean this plugin is probably activated last, so all custom post types should already be loaded.
But this only works if you made it public for the api.
See [Adding REST API Support for Custom Content Types](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-rest-api-support-for-custom-content-types/) for more information.

= I found a bug, what should I do? =

All the bugs/issues are maintained on [github.com/svrooij/rest-api-filter-fields](https://github.com/svrooij/rest-api-filter-fields/issues)
so please create an issue (or a pull request with a fix there)
so please create an issue (or a pull request with a fix) there.

== Changelog ==

= 1.0.7 =
* Filter fields enabled on users [Issue #9](https://github.com/svrooij/rest-api-filter-fields/issues/9)
* Bumped wordpress version

= 1.0.6 =
* Filter fields enabled on custom taxonomies [Issue #6](https://github.com/svrooij/rest-api-filter-fields/issues/6), thanks to [Denis Yilmaz](https://github.com/denisyilmaz) for the fix!

Expand Down
2 changes: 1 addition & 1 deletion rest-api-filter-fields/rest-api-filter-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: WP REST API - filter fields
* Plugin URI: https://github.com/svrooij/rest-api-filter-fields
* Description: Enables you to filter the fields returned by the api.
* Version: 1.0.6
* Version: 1.0.7
* Author: Stephan van Rooij
* Author URI: https://svrooij.nl
* License: MIT
Expand Down

0 comments on commit 4a2fc60

Please sign in to comment.