Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#32648 closed defect (bug) (wontfix)

Deprecate `PRIMARY_NETWORK_ID` in favor of `MAIN_NETWORK_ID`

Reported by: jeremyfelt's profile jeremyfelt Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.7
Component: Networks and Sites Keywords: dev-feedback
Focuses: multisite Cc:

Description

PRIMARY_NETWORK_ID was introduced as a new constant and primary_network_id as a new cache key in [25147]. As we use "main" rather than "primary" in every other place, it would be nice if we could rewrite history a bit and use MAIN_NETWORK_ID and main_network_id instead.

We're 6 releases in since these were introduced, so it's possible that we're stuck with what we have. If we can rename these, we should do it in the 4.3 release.

See #30294 for introduction of get_main_network_id(), #25030 for introduction of is_main_network().

Change History (9)

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


10 years ago

#2 @nacin
10 years ago

I mean, we still have SITE_ID_CURRENT_SITE, BLOG_ID_CURRENT_SITE, DOMAIN_CURRENT_SITE, PATH_CURRENT_SITE, and such. At least this one is accurate on the noun. :-)

I'd leave it alone, personally.

#3 @johnjamesjacoby
10 years ago

I'd prefer to change it (and maybe shim it if old constants or cache keys are found) but I know that's unlikely to be the popular vote.

  • *Very* few people are likely to be using this hidden feature
  • The people that are using it are probably friends of ours and we can alert them directly
  • We can alert anyone else via the make blog
  • "primary" is new terminology in our lexicon that conflicts with an existing paradigm – anecdotally, and not sarcastically, as much as I enjoy being an expert in WordPress's sometimes-goofy naming conventions, tucking this mistake under the rug forever is one less corner to get snagged on for everyone (myself selfishly included)

#4 @knutsp
10 years ago

+1
Please change this, while still possible.

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


10 years ago

#6 @obenland
9 years ago

@jeremyfelt is this still 4.3 material?

#7 follow-up: @jeremyfelt
9 years ago

  • Milestone 4.3 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I don't think it's 4.3 material at this point, and since we're 6 (soon 7) releases in, I think we should let it be.

@johnjamesjacoby's reasons are all exactly correct. We need to live with yet another rug tucking though. IMO, our best bet at sanely deprecating a constant is to start reworking how we use them via a ticket like #22251.

May this be a warning to triple check your naming (especially constants) and yet another reminder that multisite's uniqueness will continue to strike. :)

I'm closing this as wontfix. If anyone feels strongly the other way, please reopen and/or leave comments.

#8 in reply to: ↑ 7 @johnjamesjacoby
9 years ago

Replying to jeremyfelt:

May this be a warning to triple check your naming (especially constants) and yet another reminder that multisite's uniqueness will continue to strike. :)

See #32154; my concerns about new nomenclature know no bounds.

I'm closing this as wontfix. If anyone feels strongly the other way, please reopen and/or leave comments.

I feel strongly, but don't have any better arguments and prefer something like #22251 anyways.

Last edited 9 years ago by johnjamesjacoby (previous) (diff)

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


7 years ago

Note: See TracTickets for help on using tickets.