wp-load.php file does not work
-
Hi,
I am developing a plugin and using ratchet chat library in that. So, I want to save each new connection against current user so getting logged in user id like this:
require_once ('../../../../wp-config.php'); require ABSPATH . '/wp-load.php' ; global $wpdb;
$user_id = get_current_user_id();
But this does not return real user as returns 0, 0 for every thing while if I try to open my file in website it prints all data perfectly fine.
Can any body tell me where is the issue or am I doing some thing wrong ??? Help me please …
Thank You
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wp-load.php file does not work’ is closed to new replies.