WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#36994 closed defect (bug) (fixed)

Deprecate wp_get_sites()

Reported by: jeremyfelt Owned by: jeremyfelt
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch
Focuses: multisite Cc:

Description

Now that get_sites() has been introduced (See #35791) as part of WP_Site_Query, we can deprecate wp_get_sites(), which is not used within core at all.

This will entail:

  • Add deprecation notice.
  • Move function to ms-deprecated.php
  • Either adjust all tests to use get_sites() or add @ExpectedDeprecated docs where appropriate. It may be good to leave all or some of the wp_get_sites() tests to help maintain backward compatibility.

Attachments (1)

36994.diff (8.3 KB) - added by flixos90 3 years ago.

Download all attachments as: .zip

Change History (6)

@flixos90
3 years ago

#1 @flixos90
3 years ago

  • Keywords has-patch added; needs-patch removed

36994.diff deprecates wp_get_sites(). I annotated all tests that use wp_get_sites() with deprecated docs, since I think we should all keep them use the old wp_get_sites() - we already have tests for get_sites() in place, through the WP_Site_Query tests.

#2 @flixos90
3 years ago

I just noticed that another deprecated function get_blog_list() recommends wp_get_sites() as a replacement. Should this be adjusted as well to recommend get_sites() instead?

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


3 years ago

#4 @jeremyfelt
3 years ago

  • Owner set to jeremyfelt
  • Status changed from new to reviewing

#5 @jeremyfelt
3 years ago

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

In 37653:

Multisite: Deprecate wp_get_sites()

Defer to the new get_sites() replacement, offering fresh (...or cached) WP_Site objects via the new WP_Site_Query.

Props flixos90.
Fixes #36994.

Note: See TracTickets for help on using tickets.