Make WordPress Core


Ignore:
Timestamp:
11/14/2016 04:41:40 PM (8 years ago)
Author:
joehoyle
Message:

REST API: Make all collection params filterable.

For developers wanting to add their own registered collection parameters, they can now use the rest_$type_collection_params filter. This brings consistency with the already existing rest_$post_type_collection_params.

Fixes #38710.
Props jnylen0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r39219 r39223  
    12991299        );
    13001300
    1301         return $query_params;
     1301        /**
     1302         * Filter collection parameters for the users controller.
     1303         *
     1304         * This filter registers the collection parameter, but does not map the
     1305         * collection parameter to an internal WP_User_Query parameter.  Use the
     1306         * `rest_user_query` filter to set WP_User_Query arguments.
     1307         *
     1308         * @since 4.7.0
     1309         *
     1310         * @param $params JSON Schema-formatted collection parameters.
     1311         */
     1312        return apply_filters( 'rest_user_collection_params', $query_params );
    13021313    }
    13031314}
Note: See TracChangeset for help on using the changeset viewer.