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

WordPress Trac noreply at wordpress.org
Mon Oct 2 01:43:50 UTC 2017


#41684: Replace $wpdb->blogid with get_current_blog_id()
--------------------------------------+-------------------------
 Reporter:  spacedmonkey              |       Owner:  jeremyfelt
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.9
Component:  Networks and Sites        |     Version:  3.1
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  good-first-bug has-patch  |     Focuses:  multisite
--------------------------------------+-------------------------
Changes (by jeremyfelt):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41661"]:
 {{{
 #!CommitTicketReference repository="" revision="41661"
 Multisite: Use `get_current_blog_id()` instead of `$wpdb->blogid`.

 `get_current_blog_id()` is more appropriate for determining the ID of the
 current site in most cases. This eliminates the need for the global
 `$wpdb` in several functions and is better than the implicit global used
 in admin pages.

 Props bnap00, spacedmonkey.
 Fixes #41684.
 }}}

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


More information about the wp-trac mailing list