Make WordPress Core

Changeset 14410


Ignore:
Timestamp:
05/03/2010 09:02:32 PM (15 years ago)
Author:
nacin
Message:

Use get_row instead of get_var in get_site_option, aligning it with get_option, due to funkiness with 0/false/null. fixes #13043. props laceous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r14404 r14410  
    34553455
    34563456        if ( !isset($value) || (false === $value) ) {
    3457             $value = $wpdb->get_var( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
    3458 
    3459             if ( is_null($value) )
     3457            $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );
     3458
     3459            // Has to be get_row instead of get_var because of funkiness with 0, false, null values
     3460            if ( is_object( $row ) )
     3461                $value = $row->meta_value;
     3462            else
    34603463                $value = $default;
    34613464
Note: See TracChangeset for help on using the changeset viewer.