WordPress.org

Make WordPress Core

Ticket #31556: 31556-3.diff

File 31556-3.diff, 587 bytes (added by jtsternberg, 7 years ago)

Switch to using $GLOBALS['wpdb']

  • src/wp-includes/load.php

     
    353353}
    354354
    355355/**
     356 * Returns the `$wpdb` global. Can help prevent stomping of the $wpdb global.
     357 *
     358 * @since 4.1.2
     359 *
     360 * @global wpdb $wpdb The WordPress database class.
     361 * @return wpdb $wpdb The WordPress database class.
     362 */
     363function wpdb() {
     364        return $GLOBALS['wpdb'];
     365}
     366
     367/**
    356368 * Set the database table prefix and the format specifiers for database
    357369 * table columns.
    358370 *