[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
Sat Mar 7 17:42:40 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:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by johnjamesjacoby):

 I like this. It minimizes the risk of interacting with the `$wpdb` global
 object directly.

 I've been including methods in classes to do something similar for a
 while, so a central wrapper in WordPress core would prevent me from
 redefining those methods for each class that interacts with it.

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


More information about the wp-trac mailing list