Make WordPress Core


Ignore:
Timestamp:
10/05/2017 12:36:43 AM (6 years ago)
Author:
kadamwhite
Message:

REST API: Support ordering response collection by listed slugs.

Adds an "include_slug" orderby value for REST API collections to permit returning a collection filtered by slugs in the same order in which those slugs are specified.
Previously, the order of slugs provided with the ?slug query parameter had no effect on the order of the returned records.

Props wonderboymusic, ocean90, boonebgorges.
Fixes #40826.

File:
1 edited

Legend:

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

    r41731 r41760  
    244244                'registered_date' => 'registered',
    245245                'slug'            => 'user_nicename',
     246                'include_slugs'   => 'nicename__in',
    246247                'email'           => 'user_email',
    247248                'url'             => 'user_url',
     
    13391340                'registered_date',
    13401341                'slug',
     1342                'include_slugs',
    13411343                'email',
    13421344                'url',
Note: See TracChangeset for help on using the changeset viewer.