Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#33899 closed enhancement (maybelater)

Change get_current_site to get_current_network

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Networks and Sites Keywords:
Focuses: multisite Cc:


Related to on going ticket, renaming this function bring it into the line with new naming convention.

More detail:
Related: #29411 #28290

Attachments (1)

33899.patch (830 bytes) - added by spacedmonkey 8 years ago.

Download all attachments as: .zip

Change History (9)

8 years ago

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

8 years ago

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

8 years ago

#3 @jeremyfelt
8 years ago

Thanks for the ticket/patch, @spacedmonkey.

We should be wary of introducing a new function for the sole purpose of naming. I don't think get_current_site() is hurting anything at the moment, and get_current_network(), without providing any new functionality, would result in some confusion as to why both exist. It can be frustrating to keep some of the naming as is while other pieces are changing, but we can leave things as is when we don't need anything new from them.

#4 @spacedmonkey
8 years ago

Is doing type checking enough of a reason. Like checking to see if it is an instance of WP_Network? Maybe allowing it to return false like other get functions? It does change the functionality of the function...

#5 @knutsp
8 years ago

+1, but premature
We need a renaming roadmap proposal on Make Core here.

When a new function is introduced the old one should have a note that it will be deprecated in the future, now a wrapper for the new one, and recommend the new one to be used. That's a start, at least. But to do so we need a roadmap.

The get_current_blog_ functions must be included in this roadmap. My first thought on this was get_current_network_site() and get_current_network_site_id(). Another possibility is wp_get_current_site() and wp_get_current_site_id(), but I prefer the first mentioned.

Let the words "network_site" mean a site of a multisite network, as opposed to the old use of "site" meaning a network.

#6 @jeremyfelt
8 years ago

  • Keywords close added

It seems like get_network() will be a pretty good replacement once #32504 makes that available.

#7 @flixos90
8 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to fixed
  • Status changed from new to closed

Let's close this one as we have get_network() now. Now we just need to use it (see #37414).

#8 @jeremyfelt
8 years ago

  • Resolution changed from fixed to maybelater

Changing the resolution on this as we didn't necessarily fix it, just provided an alternative.

Note: See TracTickets for help on using tickets.