Check out the documentation for the get_user_by()
function – 'user_firstname'
and 'user_lastname'
aren’t properties of the returned object. This is because this data is not a part of the user model – rather they are stored in user metadata.
You should be able to use the get_userdata()
function, as it returns an object containing both user properties as well as user metadata.
Alternately, you can use get_user_meta()
to retrieve the specific metadata you’re looking for:
$first_name = get_user_meta( $user_id, 'first_name', true );
Related Posts:
- Create posts on user registration
- Categories list into registration form
- register_post_type permalink
- Allow registering user to select post category when signing up to blog
- How can I add Author’s phone number to wp profile and make it appear in wp-admin/edit.php columns
- Turn a URL into an Attachment / Post ID
- Should we trust the post globals?
- How to get the number of posts in a selected category?
- how to limit edit_form_after_title hook to page and post edit only?
- Add a checkbox to post screen that adds a class to the title
- How to cache a shortcode functions output?
- Attach pdf file to custom post type
- How to call function within a page/post, to dynamically generate content?
- Post Size Limit
- HTML code in Custom field
- Count singular post views automatically
- Looping through posts per category gives same posts for each category
- How to force update all posts after import
- how to hide specific post from google search
- Accessing $post variable from template part
- Programmatically inserting page breaks
- How to have different content in the loop and single
- Make “Post published. View post” Open in a New Tab
- get_terms parent for current product only
- How can I extract the URL of a link from a post?
- New posts defaulting to ‘0’ primary key
- Save list from a custom meta box?
- Same content shared between multiple posts?
- How to add in title a date but with other color, like in iMDb titles?
- Link button is not working while editing a post in Firefox [closed]
- How to get future ID for post which haven’t been created yet?
- Post Type Label Name
- Disable author profile in post
- How to pull blogposts using shortcodes
- Limit Gutenberg blocks available to users to choose from
- Display a post by ID attribute with shortcode
- Retain select value in select box
- How to set up multiple taxonomies for groups of posts
- Update admin side post list count text
- How can I set a Post’s default visibility to private and pending review checked
- how to get posts ids inside pre_get_posts filter?
- Blog Posts in Custom Menu
- How to allow logged in users to post anonymously
- How do I get blog posts to appear within CMS?
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- Custom Posts Query and meta_query Sort Order
- Multisite: Can’t Post or Create Categories
- Query values from a Post Object Repeater [closed]
- limit to months rather than by number of posts
- Simultaneous admin updates causes custom fields to not update
- Multiple Loops Breaking Pages
- Is there any way to tell when wp_postmeta has been updated?
- Admin – no Featured image choice in create new/page|post
- Hook for changing excerpt content when excerpt not set
- Display post number by category
- Add div before the first paragraph the_content [closed]
- Custom Post Limit for homepage only without plugin?
- Optimizing the blog loop
- Different number of posts per row in grid layout
- Static pages not working
- Adding a custom post type meta field to rss
- Is there a way of posting or inserting content directly to the database (without entering the wp-admin)?
- How to add future Posts to the new “Internal Linking” Feature
- Get other posts sharing the same meta values
- why my urdu text is not aligned properly when written in wordpress blog post?
- shortcode // get posts by ids
- get posts, run a custom query, and join the results
- Using AJAX to filter posts without refreshing page
- How to disable WordPress from automatically changing “x” to multiplication symbol “×” when typing numbers that also contain an “x” between them?
- Add class to global $post
- Multisite how to display merged posts from two sites and sort by latest date?
- How to publish a post if condition is met?
- Remove the URL author of post on all comments
- Blogposting Schema & Structured Data without plugin
- Post relationships/nesting
- wp_insert_post not inserting post
- Very weird behaviour after removing WP pages
- Grab meta data before post is saved
- How to add navigation arrows to manually slide through posts?
- Displaying dynamic content (blog posts/portfolio) on a static homepage and keep the blog post styles
- WordPress not showing recent posts
- How to change number of posts shown on homepage vs other pages?
- Posts are printed twice
- How to display most popular posts from certain category in sidebar?
- Is possible to do this from function.php
- find posts with exactly 3/4 categories
- Custom filter on all post page (admin backend)
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Displaying only posts from a certain category on my custom page template
- How can I create a menu items from meta box based on users input
- How can I count articles retrieved by tags
- WordPress strips some attributes for author posts
- Creating / Editing a post from within site template
- get value from post to sidebar
- WordPress “Posts Page” isn’t showing template dropdown
- How to have 2 posting pages on a blog
- How can I get on the same row two post of different categories?
- The WordPress wp_posts data table
- How to automatically convert a form with HTML link into post
- WordPress Post Updating is Not Working