WordPress.org

Plugin Directory

Changeset 576615


Ignore:
Timestamp:
07/24/12 12:56:27 (21 months ago)
Author:
donncha
Message:

Check if $wpdb->blogs exists before checking the table as single sites don't have this table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • polldaddy/trunk/polldaddy-client.php

    r569913 r576615  
    11711171         
    11721172        global $wpdb;        
    1173         $public = (int) $wpdb->get_var( $wpdb->prepare( "SELECT public FROM {$wpdb->blogs} WHERE blog_id = %d", $wpdb->blogid ) ); 
    1174         if( $public == -1 ) 
    1175             $args['makePublic'] = 'no'; 
     1173        if ( isset( $wpdb->blogs ) ) { // single hosted WordPress sites don't have a blogs table. 
     1174            $public = (int) $wpdb->get_var( $wpdb->prepare( "SELECT public FROM {$wpdb->blogs} WHERE blog_id = %d", $wpdb->blogid ) ); 
     1175            if( $public == -1 ) 
     1176                $args['makePublic'] = 'no'; 
     1177        } 
    11761178 
    11771179        foreach ( array( 'styleID', 'packID', 'folderID', 'languageID', 'choices', 'blockExpiration' ) as $int ) 
Note: See TracChangeset for help on using the changeset viewer.