I couldn't get the current userid using get_currentuserinfo() in Wordpress -


i new in wordpress, created wordpress api using wp rest api . created custom route in api in callback didn't current user id , user details using function get_currentuserinfo()

in wordpress 4.5 function get_currentuserinfo() has been deprecated

replace

get_currentuserinfo() 

with

wp_get_current_user(); 

deprecated info found here : https://developer.wordpress.org/reference/functions/get_currentuserinfo/

have try this. current user information .


Comments

Popular posts from this blog

Listboxes in c# -

Excel Duty List -

Multilayer CSV to filtered excel -