WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37621 closed defect (bug) (fixed)

Incorrect docs for `$number` argument in `WP_Site_Query`

Reported by: flixos90 Owned by: wonderboymusic
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.6
Component: Networks and Sites Keywords: has-patch
Focuses: docs, multisite Cc:

Description

The docs for the $number argument of WP_Site_Query are wrong. The default value is 100, not null as it currently states.

Attachments (2)

37621.diff (1.0 KB) - added by flixos90 3 years ago.
37621.2.diff (3.1 KB) - added by flixos90 3 years ago.

Download all attachments as: .zip

Change History (9)

@flixos90
3 years ago

#1 @flixos90
3 years ago

  • Keywords has-patch added; needs-patch removed

37621.diff fixes the docs.

#2 @flixos90
3 years ago

I actually think that is a strange default though. It should probably rather be null, as in other queries, not limiting anything. Was there any particular reason for specifying 100 here?

#3 @swissspidy
3 years ago

  • Version set to trunk

Introduced in [37477] / #35791.

I assume 100 was chosen as a sane default for huge networks. For example, posts_per_page in WP_Query is limited to.

35791.4.patch:ticket:35791 was the first patch with that limit. See 12:ticket:35791.

#4 @SergeyBiryukov
3 years ago

On a related note, in WP_Network_Query, $number should be Default empty rather than Default null.

@flixos90
3 years ago

#5 @flixos90
3 years ago

37621.2.diff fixes the $number docs in WP_Network_Query, and also in WP_Comment_Query (same mistake there).

#6 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to 4.7

#7 @wonderboymusic
3 years ago

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

In 38336:

Query: use correct description in the docblock for $number in WP_Comment_Query, WP_Network_Query, and WP_Site_Query.

Props flixos90.
Fixes #37621.

Note: See TracTickets for help on using tickets.