Title: Using current_user(obj) externally in 3.1
Last modified: August 19, 2016

---

# Using current_user(obj) externally in 3.1

 *  Resolved [dvelguru](https://wordpress.org/support/users/dvelguru/)
 * (@dvelguru)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/using-current_userobj-externally-in-31/)
 * This used to work in previous versions:
    include_once ‘../../../wp-config.php’;
   include_once ‘../../../wp-load.php’; include_once ‘../../../wp-includes/wp-db.
   php’; include_once ‘functions.php’;
 * return $current_user->ID;
 * But now, it’s returning 0.
 * I have an upload.php file that one of my jquery upload scripts is using, and 
   I’d like to use $wpdb, and $current_user objects, but it’s not working.
 * Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [dvelguru](https://wordpress.org/support/users/dvelguru/)
 * (@dvelguru)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/using-current_userobj-externally-in-31/#post-1984908)
 * I’ve even switched the order of the includes around, to no success.
 *  [Kitefr](https://wordpress.org/support/users/kitefr/)
 * (@kitefr)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/using-current_userobj-externally-in-31/#post-1985202)
 * Hi,
 * How did you resolved it ?!
 *  [vladimir.bujak](https://wordpress.org/support/users/vladimirbujak/)
 * (@vladimirbujak)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/using-current_userobj-externally-in-31/#post-1985240)
 * Hi Guys!
    Does anyone knows how to solve this issue? it used to work for me before
   and after upgrading WP it is not.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Using current_user(obj) externally in 3.1’ is closed to new replies.

## Tags

 * [current_user](https://wordpress.org/support/topic-tag/current_user/)
 * [external](https://wordpress.org/support/topic-tag/external/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * 3 replies
 * 3 participants
 * Last reply from: [vladimir.bujak](https://wordpress.org/support/users/vladimirbujak/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/using-current_userobj-externally-in-31/#post-1985240)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
