WordPress.org

Make WordPress Core

#38039 closed enhancement (fixed)

Invalid PHPDOC for get_sites

Reported by: MaximeCulea Owned by: DrewAPicture
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.6.1
Component: Networks and Sites Keywords: has-patch
Focuses: docs, multisite Cc:

Description

It seems that the PHPDOC for get_sites is invalid.

While it is written that the $network_id arg allows to Limit results to those affiliated with a given network ID. Default current network ID..
In fact if we look closely to WP_Site_Query and his $network_idarg, it is specified that Limit results to those affiliated with a given network ID. If 0, include all networks. Default 0..

So when using get_sites with no network_id given, it will not return sites from the current network but from all networks.

Attachments (1)

patch_38039.diff (1.2 KB) - added by MaximeCulea 10 months ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
10 months ago

  • Milestone changed from Awaiting Review to 4.7

#2 @flixos90
10 months ago

  • Keywords has-patch added
  • Owner set to DrewAPicture
  • Status changed from new to reviewing

Thanks for the patch @MaximeCulea!

#3 @flixos90
10 months ago

  • Focuses docs added

#4 @SergeyBiryukov
10 months ago

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

In 38596:

Docs: Synchronize docblocks for WP_Site_Query::__construct() and get_sites() after the changes in [37735], [38008], [38103], and [38336].

Props MaximeCulea.
Fixes #38039.

Note: See TracTickets for help on using tickets.