[wp-trac] [WordPress Trac] #31556: `$wpdb` global object should be retrieved via a helper function to help prevent global stomping

WordPress Trac noreply at wordpress.org
Fri May 1 07:30:44 UTC 2015


#31556: `$wpdb` global object should be retrieved via a helper function to help
prevent global stomping
-----------------------------------+------------------------------
 Reporter:  jtsternberg            |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Query                  |     Version:  4.2
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by pento):

 I'm not wild about this. It seems like it'd involve a lot of churn in both
 core (if we're providing this, we should use it), and in plugins, for when
 their minimum version catches up to this.

 The only thing it prevents is clobbering $wpdb, which you're going to
 notice pretty quickly. It doesn't prevent more subtle errors which are
 harder to catch. (For example, changing $wpdb->charset.)

 Also, is this proposal just for $wpdb, or all of the globals WordPress
 provides?

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


More information about the wp-trac mailing list