Jump to content

Help with simple WORDPRESS fetch.


DamienRoche

Recommended Posts

Hi guys,

 

I am trying to fetch a username based on the frequent:

 

if (is_user_logged_in())

 

But how do I know which user is logged in? basically, I want something like this:

 

if (is_user_logged_in()){

$username = ; ////this is where I'm stuck 

echo "$username";
}

 

Any help is greatly appreciated. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/122016-help-with-simple-wordpress-fetch/
Share on other sites

Usually here we talk about php alone, not used in pre-made applications as that can make stuff a lot difficult. Each system has it's own way of handling stuff and wordpress isn't an exception. Maybe it uses sessions, cookies, or any other method which i'm not aware. You should read that on the wordpress documentation.

Thanks for the input. I'm guessing you don't have experience with Wordpress then?

 

Has anyone got any other advice? I would really appreciate a little help with this.

 

I have searched through the documentation quite extensively but am yet to find something.

 

Thanks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.