Make WordPress Core

Changeset 40427

Timestamp:
04/14/2017 08:53:11 AM (7 years ago)
Author:
swissspidy
Message:

REST API: Allow fetching multiple terms at once via the slug parameter.

This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).

Props wonderboymusic, MatheusGimenez, curdin.
Fixes #40027.

Merges [40376] to the 4.7 branch.

Location:
branches/4.7
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r39957 r40427  
    980980        $query_params['slug'] = array(
    981981            'description'       => __( 'Limit result set to terms with a specific slug.' ),
    982             'type'              => 'string',
     982            'type'              => 'array',
     983            'items'             => array(
     984                'type'          => 'string'
     985            ),
    983986        );
    984987
  • branches/4.7/tests/phpunit/tests/rest-api/rest-tags-controller.php

    r39372 r40427  
    375375        $this->assertEquals( 1, count( $data ) );
    376376        $this->assertEquals( 'Apple', $data[0]['name'] );
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
    377411    }
    378412
  • branches/4.7/tests/qunit/fixtures/wp-api-generated.js

    r40426 r40427  
    19911991                            "required": false,
    19921992                            "description": "Limit result set to terms with a specific slug.",
    1993                             "type": "string"
     1993                            "type": "array",
     1994                            "items": {
     1995                                "type": "string"
     1996                            }
    19941997                        }
    19951998                    }
     
    22262229                            "required": false,
    22272230                            "description": "Limit result set to terms with a specific slug.",
    2228                             "type": "string"
     2231                            "type": "array",
     2232                            "items": {
     2233                                "type": "string"
     2234                            }
    22292235                        }
    22302236                    }
Note: See TracChangeset for help on using the changeset viewer.