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
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- Which hook should be used to add an action containing a redirect?
- Is it worth checking if class_exists when developing a plugin and how to do it?
- the_content after all shortcodes are parsed
- How do I resolve Notice: Undefined offset: 0 in /wp-includes/capabilities.php on line 1145
- Category listing with thumbnail and description on home page
- How can the tinyMCE dom be manipulated (offical API does not seem to work)?
- Pass javascript result to shortcode executer function
- URLs of plugin resources?
- anything like add_meta_box for categories?
- Can we create a category list page in WordPress?
- How to include class from addon after to be sure one class exists in the main plugin?
- Developing a plug-in to charge for
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- What is the Difference between directly call a function and call a function using add_action?
- What is better way to use Bootstrap inside admin panel?
- Updating my plugin without releasing a new version
- Is it possible to check is loaded language files correctly with WordPress plugin?
- Default category got deleted. How to get it back as ID=1?
- What allows a template file from plugin to be copied in child theme and overridden?
- creating custom archive template within plugin for custom post type using archive_template filter
- Advice on plugin structure
- Problem with parameters in url and pagination
- Trying to understand order and frequency of action hooks firing
- Where can i find wordpress auto update code flows?
- Create & Save multiple Meta-boxes
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- jQuery selectors for editor elements safe to use?
- wp_set_object_terms not updating database without a die()
- WordPress form action – doesn’t work
- How to fetch only current hour posts?
- template_redirect or admin-ajax.php?
- how to get all the child category name in a specified category name?
- Widget HTML Display Problem
- Change WooCommerce Email Header using custom plugin
- add_submenu_page hooked function must explicitly check user capabilities – why?
- How to apply style_loader_src filter with exclusion of a specific file?
- Which is the better way to store images for the plugin?
- Mixing l18n string from my plugin with WordPress’ translations
- Minimum Widget Width for Plugin Development
- Adding Author Box Meta Links with Co-Authors
- Should I use wp-content/cache or [PLUGIN_DIR]/cache?
- configuration of .htaccess for add_rewrite_rule to make sense
- Restrict certain actions to plugin-specific admin menu pages only
- Adding tables to dashboard pages programmatically?
- how to add custom fields into new & update post page?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- List all user post API endpoint
- Condition to check previous next article post title
- How to display plugin with javascript using markup of the theme?
- Can display plugin without shortcode?
- How to prevent wp_insert_post from creating a new post every second?
- Multisite and the JSON REST API: How to?
- Looping single post in a theme
- WP Ajax on page load not working on bluehost but was working on Godaddy
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- How to create an embedded code for wordpress shortcode?
- How can I send an id over the url?
- grouping my widgets wordpress
- Validate user meta and redirect
- Creating custom Insert Media page
- Get fields of a widget
- Initialize class inside plugin
- “Print to printer” functionality in a plugin
- How do you filter get_media_items by mime type in a custom media upload tab?
- Which subset of html does WordPress support?
- How to set init for maximum script execution, memory limit and max files upload in wordpress
- Trying to build a plugin – Cannot modify header information
- Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it
- multiple record insert creating many duplicate records