[wp-trac] [WordPress Trac] #41684: Replace $wpdb->blogid with get_current_blog_id()

WordPress Trac noreply at wordpress.org
Mon Aug 21 19:09:05 UTC 2017


#41684: Replace $wpdb->blogid with get_current_blog_id()
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Networks and Sites                   |  Review
 Severity:  normal                               |     Version:  3.1
 Keywords:  needs-patch good-first-bug needs-    |  Resolution:
  unit-tests                                     |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 Thanks for the patches @bnap00 . Some quick notes.

 - In the switch_to_blog / restore tests, put the $wpdb->blogid. The test
 is testing that value has changed. That is one example that we can't
 remove it, as it invalidates the test.
 - Check all functions, if that function no longer needs the global $wpdb
 and update the documentation. See `wpmu_update_blogs_date` and
 `ms_upload_constants` as example.
 - Restore `wp_get_db_schema` back to $wpdb->blogid. This seems to be a
 special case where get_current_blog_id will not work as it is loaded
 early.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41684#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list