Closed jerclarke closed 8 years ago
BLOG_ID_CURRENT_SITE is used mostly with multi networks, but should exist even on some really old WPMU instances, if you've upgraded them to the modern era... How weird.
I think this would work:
$blog_id_current_site = 1;
if (defined('BLOG_ID_CURRENT_SITE')) {
$blog_id_current_site = BLOG_ID_CURRENT_SITE;
}
Why the 1? Well, that's actually the default, and it's only if you've changed it would be different.
But have you updated this site? Is it on 4.6+
Okay. Well I'm willing to define it manually if you say that 1 is a safe default for single-network multisite :) Just wasn't sure and couldn't find any references. This particular WPMU has always been an odd duck.
It's on 4.5.3 still (upgrading everything after our big move to Ubuntu 16.04/php7). No idea if that would solve this issue but sounds like it goes back a lot farther.
Thanks for the feedback.
Hey, this one I'm not sure how to interpret, but we're getting a regular stream of notices on our non-subdomain multisite install. It dates back to the dark ages of WPMU when path-based multisite wasn't considered insane.
Here's the notice:
Here's the code:
The code assumes that based on the other conditions (!SUBDOMAIN_INSTALL),
BLOG_ID_CURRENT_SITE
will already be set, but in our case it clearly isn't. I tried looking upBLOG_ID_CURRENT_SITE
but couldn't find anything useful.My inclination is to submit a PR where we validate
BLOG_ID_CURRENT_SITE
before using it, but I don't know if that would significantly change the behavior of your plugin. Here's what I'd think is right:Above the
if
statement, then using$blog_id_current_site
in the test. Does that make sense to you?