Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#40213 closed enhancement (fixed)

REST API: Users endpoint slug parameter should allow an array of slugs

Reported by: curdin Owned by: jnylen0
Priority: normal Milestone: 4.7.4
Component: REST API Version: 4.7
Severity: normal Keywords: has-patch has-unit-tests fixed-major i18n-change
Cc: Focuses: rest-api

Description

The users endpoint should allow an array or csv to be passed into the slug parameter, matching user slugs with any value in the array. At current it is limited to deal with strings as discovered while working on #40027.

This change would provide consistency with the other endpoints.

Related: #38579

Attachments (3)

40213.diff​ (1.5 KB ) - added by MatheusGimenez 10 years ago.
Added support to array and comma-separated to slug param
40213.1.diff​ (4.5 KB ) - added by curdin 10 years ago.
Added unit tests
40213.2.diff​ (4.2 KB ) - added by jnylen0 10 years ago.
Minor updates (tests and formatting)

Download all attachments as: .zip

Change History (14)

@MatheusGimenez
10 years ago

Added support to array and comma-separated to slug param

#1 @MatheusGimenez
10 years ago

  • Keywords has-patch needs-testing needs-unit-tests added

@curdin
10 years ago

Added unit tests

#2 @curdin
10 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed

Have added unit tests to @MatheusGimenez 's patch

#3 @curdin
10 years ago

@jnylen0 This is ready for review - might be worthwhile committing it with #40027 if you're happy with it.

This ticket was mentioned in ​Slack in #core by swissspidy. ​View the logs.


10 years ago

#5 @swissspidy
10 years ago

  • Milestone Awaiting Review → 4.7.4

Moving to the milestone for consideration.

@jnylen0
10 years ago

Minor updates (tests and formatting)

#6 @jnylen0
10 years ago

  • Keywords commit added; needs-testing removed

With some minor updates to tests and formatting (whitespace, etc) in 40213.2.diff​, this is looking good and working well. Nice catch on getting rid of the search thing as well, I believe that previously slug would have overridden any search parameter. Committing when tests pass.,

#7 @jnylen0
10 years ago

  • Owner set to jnylen0
  • Resolution → fixed
  • Status new → closed

In 40378:

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

This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.

#8 @jnylen0
10 years ago

  • Keywords fixed-major added; commit removed
  • Resolution fixed
  • Status closed → reopened

Reopening for backport to 4.7 branch.

#9 @jnylen0
10 years ago

  • Keywords i18n-change added

Note this includes a string change (cc @ocean90). See also: ticket:40027#comment:22

#10 @swissspidy
10 years ago

  • Resolution → fixed
  • Status reopened → closed

In 40426:

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

This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.

Merges [40378] to the 4.7 branch.

#11 @swissspidy
10 years ago

Note that I merged this to the 4.7 branch without the string change as none of the other string changes from the mentioned tickets have made it into this release. Better to keep it that way, given that we now release much earlier than originally planned.

Note: See TracTickets for help on using tickets.