How to call WP functions from outside WP?
-
Hi.
I’m developing a plugin (myPlugin.php) and have added the following lines in this file:
global $current_user; get_currentuserinfo();
This allows me to access e.g. $current_user->ID from myfile.php
I’m using jQuery.post to call a php file (lets call it test.php).
Inside test.php I’m trying to get $current_user->ID, but I get zero results. If I try adding get_currentuserinfo(), I get a message saying that is doesn’t know the function get_currentuserinfo().So how can I retrieve user info from test.php which is called from jQuery.post?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to call WP functions from outside WP?’ is closed to new replies.