WordPoints / wordpoints

Points plugin for WordPress
GNU General Public License v2.0
20 stars 15 forks source link

Multisite: use get_current_blog_id() instead of $wpdb->blogid #742

Closed JDGrimes closed 6 years ago

JDGrimes commented 7 years ago

See https://core.trac.wordpress.org/ticket/41684#comment:12

JDGrimes commented 6 years ago

For future reference:

Note that we discovered that the value of $wpdb->blogid and get_current_blog_id() differ when multisite is not enabled. On multisite they are the same, but when not on multisite $wpdb->blogid = '0' and get_current_blog_id() = 1. I decided that we needed to maintain the previous values for back-compat when not on multisite. We could have attempted to update the database, but the problem would be that code may already be expecting the current values, so that would have been a breaking change. For legacy reasons, we'll just leave it as it is.

See https://github.com/WordPoints/wordpoints/pull/755#pullrequestreview-83175699.