Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41789 closed defect (bug) (fixed)

get_sites() returns an integer when 'count' is passed as a query var

Reported by: ocean90's profile ocean90 Owned by: jeremyfelt's profile jeremyfelt
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch
Focuses: docs, multisite Cc:

Description

But the current @return tag only mentions an array.

Attachments (1)

41789.diff (1.8 KB) - added by jeremyfelt 7 years ago.

Download all attachments as: .zip

Change History (13)

#1 @ocean90
7 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 41331:

Multisite: Clarify return type of get_sites() when 'count' is passed as a query var.

Fixes #41789.

#2 @johnbillion
7 years ago

In 41333:

Multisite: More specificity for the get_sites() documentation.

See #41789

#3 @ocean90
7 years ago

@johnbillion That specificity is incorrect. get_sites() can also return an array of IDs.
Also, why didn't you update get_sites()? And while we're on it, we should probably make the docs consistent across all the query classes.

#4 @johnbillion
7 years ago

  • Keywords needs-patch added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Let's try again.

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


7 years ago

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


7 years ago

#7 @jeremyfelt
7 years ago

How about:

array|int Defaults to list of WP_Site objects. A list of site ids when 'fields' is set to 'ids'. The number of sites when 'count' is passed as a query var.

  • On WP_Site_Query's query() and get_sites() and in the get_sites() function.
  • Similarly with networks on WP_Network_Query's query() and get_networks() and in the get_networks() function.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


7 years ago

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


7 years ago

#10 @melchoyce
7 years ago

@johnbillion Still trying to get this one in 4.9?

@jeremyfelt
7 years ago

#11 @jeremyfelt
7 years ago

  • Keywords has-patch added; needs-patch removed
  • Owner changed from ocean90 to jeremyfelt
  • Status changed from reopened to reviewing

Let's go with 41789.diff for 4.9. We can address the documentation of other queries in another ticket.

#12 @jeremyfelt
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 41912:

Multisite: Document all return types in get_sites().

Adds more complete documentation to get_sites() and the corresponding methods in WP_Site_Query.

Fixes #41789.

Note: See TracTickets for help on using tickets.