[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 16:59:13 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       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 As a matter of convenience and even to provide a small amount of
 resilience to the `$wpdb` global, it makes sense that we provide a utility
 to function to return it. This would allow things like:

 {{{
 wpdb()->get_col( wpdb()->prepare() );
 }}}
 etc.

 the entirety of the patch looks like:

 {{{
 function wpdb() {
         global $wpdb;
         return $wpdb;
 }
 }}}

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


More information about the wp-trac mailing list