Changeset 1609682
- Timestamp:
- 03/07/2017 11:16:03 AM (9 years ago)
- Location:
- rest-api-filter-fields/trunk
- Files:
-
- 3 edited
-
includes/class-rest-api-filter-fields.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
rest-api-filter-fields.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rest-api-filter-fields/trunk/includes/class-rest-api-filter-fields.php
r1571403 r1609682 30 30 // Add de filter. The api uses eg. 'rest_prepare_post' with 3 parameters. 31 31 add_filter('rest_prepare_'.$post_type_name,array($this,'filter_magic'),20,3); 32 } 33 34 } 35 36 $tax_types = get_taxonomies(array('public' => true), 'objects'); 37 38 foreach ($tax_types as $tax_type) { 39 40 //Test if this posttype should be shown in the rest api. 41 $show_in_rest = ( isset( $tax_type->show_in_rest ) && $tax_type->show_in_rest ) ? true : false; 42 if($show_in_rest) { 43 44 // We need the postname to enable the filter. 45 $tax_type_name = $tax_type->name; 46 47 //die($post_type_name); 48 49 // Add de filter. The api uses eg. 'rest_prepare_post' with 3 parameters. 50 add_filter('rest_prepare_'.$tax_type_name,array($this,'filter_magic'),20,3); 32 51 } 33 52 -
rest-api-filter-fields/trunk/readme.txt
r1571403 r1609682 4 4 Tags: json, rest, api, rest-api 5 5 Requires at least: 4.4 6 Tested up to: 4.7 7 Stable tag: 1.0. 56 Tested up to: 4.7.3 7 Stable tag: 1.0.6 8 8 License: MIT 9 9 License URI: https://raw.githubusercontent.com/svrooij/rest-api-filter-fields/master/LICENSE … … 98 98 == Changelog == 99 99 100 = 1.0.6 = 101 * 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! 102 100 103 = 1.0.5 = 101 * Support for embedded fields (when you include the '_embed'GET parameter!).104 * Support for embedded fields (when you include the `_embed` GET parameter!). 102 105 * The `_links` field doesn't get stripped anymore. 103 106 * Taking the first element of an collection with `first`, like `_embedded.author.first.name`. -
rest-api-filter-fields/trunk/rest-api-filter-fields.php
r1571403 r1609682 11 11 * Plugin URI: https://github.com/svrooij/rest-api-filter-fields 12 12 * Description: Enables you to filter the fields returned by the api. 13 * Version: 1.0. 513 * Version: 1.0.6 14 14 * Author: Stephan van Rooij 15 15 * Author URI: https://svrooij.nl
Note: See TracChangeset
for help on using the changeset viewer.