Reputation: 4375
I am trying to integrate my site to use the bbpress/wordpress user system.
All I need is the ability to get the User Name and/or User ID of the person currently on my site. I don't really need any other functionality from bbpress or wordpress on the site.
If I could get the user's ID and then the ability to get the user's name from that ID would be perfect for all of my needs.
Additional Info: My site is ran on PHP5 and MySQL, I have wordpress and bbpress upto date and currently integrated with each other.
Upvotes: 3
Views: 1113
Reputation: 180095
Have you tried just printing out the contents of $_COOKIE
? Mine contains the following:
Array
(
[wordpress_test_cookie] => WP Cookie check
[wordpress_logged_in_##########] => ceejayoz|#####|##########]
)
Should be simple for you to parse.
foreach($_COOKIE as $key => $value) {
if(preg_match('@^wordpress_logged_in_@', $key) {
$cookie = explode('|', $_COOKIE[$key]);
$username = $cookie[0];
}
}
Upvotes: 3