If you’re trying to get user data for the displayed profile, you can do it like so:
$thisauthor = get_userdata(intval($author));
That’ll return an object filled with everything you need. For instance, if you need the user ID, you can call it like so:
$thisauthor->ID
I use this extensively on the profiles on my site: http://androidandme.com/user/clark
UPDATE
In a plugin, it looks like you need to call the global variable first, like so:
global $author; $thisauthor = get_userdata(intval($author));
Related Posts:
- Update a user profile via frontend
- Where the Nickname is being used in WordPress
- Add new user and add meta at once
- How to add quick edit and bulk edit fields to users admin section
- What is rich_editing?
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- Ensure function has completed before allowing another Ajax call
- Comments do not respect display_name setting, how to make plugin to overcome this
- How to add custom fields to the all users page
- Display custom fields in frontside user profile
- WordPress allows multiple users to have same email ID; and I’ve a problem with it!
- How to build a fool proof AdSense revenue sharing model?
- How can I add a simple custom field to my plugin?
- First and last name fields not filled when using wp_insert_user
- How do I change the image from the default mysteryman in the WP Profile page
- Associate multiple email addresses with the same user account, so they can log in with either
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Change/Set Page Title and Meta Tags from Page Called within a Plugin
- How to relate the Category to user?
- Catching a GET parameter from the URL and save it in the user meta when a user registers
- Insert, update or remove data from database (usermeta)
- User meta query using Wildcard
- User avatar-ACF fields
- WordPress function is not called and ajax return 0
- Plugin MySQL SELECT custom data and filter on user meta
- How to work with AJAX and WordPress?
- Need edit profile link in the menu for logged in users
- Create Unique and Customized User ID for Website Members in WordPress
- How to get custom user meta by id in custom Gutenberg block
- Google Web Core Vitals – management, how to in wordpress and advice
- Detect if requested page is PWA on server side
- Allowing duplicating users with same user_login and user_email
- Information and Page from WordPress Plugin
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- How to add quick edit on the list of users to edit custom fields?
- How to control ajax calls without effecting memory of server?
- How to query a nested field in wordpress api using _fields param
- function add custom fields to media gallery
- How to Run Plugin on Server Without Web Browser
- WordPress admin panel not working
- Impossible to declare box-shadow with wp.customize?
- update_option() passing empty array() but still updating
- Bad request 400 using class based files
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- Gutenberg block breaks when showing new data
- Allow contributor user role to perform copy operation PHP
- How to use own css of functionality plugin?
- Get Custom taxonomy parent with wordpress REST API
- How to add .ini file type to the plugin editor to read and edit?
- Do I lose translations when I change my Text domain for my plugin on wp.org?
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- What to do with the .git folder in a WordPress plugin during local development
- register_meta not showing custom post type metabox data in rest api
- Trying to rename a file upload as the hash of file content on wordpress
- Adding the image selector/uploader to an admin back page
- How to write a custom shortcode name book?
- converting a node.js project into a wp plugin
- What happens/fires when you select a block in the editor?
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Is “document loaded” different on admin side than public side?
- Determine if term is Category or Tag
- Check current URL is 404 in pre_option_stylesheet filter hook
- Where to add functions and code snippets in wordpress
- Hook to execute after deleting a Custom Taxonomy
- How to re-render inspector controls?
- Override category archive page title (not the head title)
- Forbidden Error in ajax call with wordpress
- `registration_errors` filter doesn’t seem to be called
- Why User_login key doesn’t work with wp_update_user()
- How to use setAttributes outside of the edit function return
- WP plugin svn checkout 429 error “Too many requests”
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- How to grab data after wp user search is complete
- Limit get_next_post to posts from the same author
- How to Login a User inside a Plugin and Redirect to page?
- Using custom IDP with WP
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- Show list of categories that has posts with different taxonomies
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- Securing custom rest API endpoints with public access from PWA
- How do I add filter with woocommerce categories?
- ACF Field value in wordpress login message filter
- Where do I hook to have the server do something in PHP on block attribute change?
- admin-post.php form handling only working when logged in as admin
- Undefined cache functions in my custom plugin
- Some difficulties in implementing markdown editor
- By adding “?login – failed” code unable to access my dashboard
- ajax stopped working when not logged in wordpress
- Change cannonical URL after changing url with add_rewrite_rule()
- jQueryUI draggable doesn’t work in WordPress plugin
- Sanitization and validation input fields – Settings API
- WordPress shortcode with a switch
- Twenty-seventy theme remove additional CSS from head
- call funcution when clicking submit
- How to revive (or take over) a plugin?
- WP_Query not ordering correctly
- WooCommerce – Stop assigning order numbers
- Make visible page only in the trash
- How to check category name available or not