WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#32512 closed enhancement (fixed)

Reuse site objects in MS user and site list tables rather than calling get_blog_status()

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

Description

In class-wp-ms-users-list-table.php and class-wp-ms-sites-list-table.php, we loop through sites and use get_blog_status() to determine if each is archived, spam, mature, or deleted.

As highlighted in #32281, this data is available from the database as part of the site object and can be reused.

Attachments (1)

32512.diff (8.4 KB) - added by jeremyfelt 4 years ago.

Download all attachments as: .zip

Change History (3)

@jeremyfelt
4 years ago

#1 @jeremyfelt
4 years ago

32512.diff

  • Removes uses of get_blog_status() from both the sites and users MS list table.
  • Adds mature as a property when retrieving site objects from get_blogs_of_users().

Core's only other use of get_blog_status() is in is_archived(), which we may be able to deprecate.

#2 @jeremyfelt
4 years ago

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

In 32630:

Use site objects rather than get_blog_status() in MS list tables.

Removes several repetitive calls to get_blog_status() that are not needed, as the data is already available as part of each site's object.

Fixes #32512.

Note: See TracTickets for help on using tickets.