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

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -