WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 7 months ago

#42091 reopened enhancement

Use get_site_by() in get_id_from_blogname()

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

Description

The introduction of get_site_by() (see #40180) gives us the opportunity to clean up some similar code.

Attachments (2)

42091.diff (985 bytes) - added by jeremyfelt 9 months ago.
42091.2.diff (1.3 KB) - added by jeremyfelt 9 months ago.

Download all attachments as: .zip

Change History (7)

@jeremyfelt
9 months ago

@jeremyfelt
9 months ago

#1 @jeremyfelt
9 months ago

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

In 41743:

Multisite: Use get_site_by() in get_id_from_blogname().

Fixes #42091.

#2 @flixos90
8 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

As get_site_by() will be reverted (see https://core.trac.wordpress.org/ticket/40180#comment:36), this needs to be reverted as well. It can be merged back in once get_site_by() is actually ready.

#3 @flixos90
8 months ago

In 41884:

Multisite: Revert [41698] and [41743].

In order for get_site_by() to be truly beneficial, caching in WP_Site_Query needs to be improved to account for common use-cases and have them be invalidated less aggressively.

See #40180, #40228, #42091.

#4 @flixos90
8 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from 4.9 to 5.0

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


7 months ago

Note: See TracTickets for help on using tickets.