Plugin Directory

Changeset 1609682


Ignore:
Timestamp:
03/07/2017 11:16:03 AM (9 years ago)
Author:
svrooij
Message:

Committing 1.0.6 to trunk

Location:
rest-api-filter-fields/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • rest-api-filter-fields/trunk/includes/class-rest-api-filter-fields.php

    r1571403 r1609682  
    3030      // Add de filter. The api uses eg. 'rest_prepare_post' with 3 parameters.
    3131      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);
    3251    }
    3352
  • rest-api-filter-fields/trunk/readme.txt

    r1571403 r1609682  
    44Tags: json, rest, api, rest-api
    55Requires at least: 4.4
    6 Tested up to: 4.7
    7 Stable tag: 1.0.5
     6Tested up to: 4.7.3
     7Stable tag: 1.0.6
    88License: MIT
    99License URI: https://raw.githubusercontent.com/svrooij/rest-api-filter-fields/master/LICENSE
     
    9898== Changelog ==
    9999
     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
    100103= 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!).
    102105* The `_links` field doesn't get stripped anymore.
    103106* 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  
    1111 * Plugin URI:          https://github.com/svrooij/rest-api-filter-fields
    1212 * Description:         Enables you to filter the fields returned by the api.
    13  * Version:             1.0.5
     13 * Version:             1.0.6
    1414 * Author:              Stephan van Rooij
    1515 * Author URI:          https://svrooij.nl
Note: See TracChangeset for help on using the changeset viewer.