FIX: Move global $wpdb into conditional