wp_get_current_user outside wordpress
Thanks for contributing an answer to WordPress Development Stack Exchange! How do I align things in the following tabular environment? Cadastre-se e oferte em trabalhos gratuitamente. Work with both tables wp_usermeta and wp_users. How to Display a User's IP Address in WordPress - WPBeginner When using this in the constructor of a class I found this function gave an error. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. The current user will be set to the logged-in person. Doesn't work for me. Instead, define a function that gets the user information: You can then use this function anywhere in your theme without issue. I was insterting my script in html