It appears that you are storing the data in the post’s meta, not user’s meta. Therefore, you need to retrieve it by directly getting the meta for that post, not by doing a user query.
Let’s say your post’s ID is $post_id
:
First, retrieve the meta by get_post_meta()
:
$users = get_post_meta ( $post_id, 'post_liked_users', false );
I assumed that you are storing the data as multiple serialized ( based on your question ), so I set the last parameter of the above function to false, which will retrieve every meta, and we will try to extract the array:
if ( $users ) {
foreach ( $users as $user ) {
// $user[0] is the user-1 string here, and
// $user[1] is the integer ( their ID )
echo get_user_by( 'id', $user[1] )->display_name;
}
}
Related Posts:
- Create a global variable for use in all templates
- Build a content and excerpt grid loop with paging and options for # of posts
- What is the most efficient way to search users by their display name?
- Can i check if user is doing any ajax request?
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- How to add 2 posts under another post? Formatting should be intact
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Use wp_get_recent_posts with search term
- Remove query string specific key value
- How to prevent WP_Query function from returning all posts when empty?
- Display a specific category of products in shop page and disable code for specific actions
- Remove echo from shortcode
- Call to undefined function get_userdata() in plugin
- Security for data obtained from the database
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- change the default order of posts only for specific categories
- Post not populating for custom post type based on category selection
- Custom query vars filters problem with pagination
- How to get post category list as select in front-end?
- Displaying Event within two given time frames
- Use of antispambot with $curauth->email
- Uses for function: wp_update_user
- Let current user know pending posts counts using wp_query
- Output product category link from WP_Query
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- “pre_get_posts” orderby custom date field in different format?
- Change wordpress’ database data using ajax – how to get current user id?
- Allow a user or role to view drafts and previews, but not other admin privileges?
- How to exclude meta no index pages from wp_list_pages
- WP query posts BUT show the most recent and one per author
- Get current user id in function php
- Ajax filter with loadmore button
- posts_per_page displays only 2 posts instead of 4 posts
- Delete post meta by serialized meta value
- Display current user metadata on WordPress page
- Modify post image in full size
- WP_Query To Display Product Of Brand On Taxonomy Page
- Add another role to a user when they click a button?
- Query to show average # of months all accounts with specific role have been active
- is_user_logged_in() not working in homepage
- Custom Post type Ajax search results
- Can’t get_users info by using json_encode
- Matching multi user
- My query keeps looping infinitely ! how to stop it?
- Private messaging – Getting and displaying the avatar/url of a message recipient
- How can I display a query in a page?
- Loop 1 user randomly
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- Weird Behaviour: Not all WordPress Posts appearing
- main menu page redirects to user ID
- List sibling pages widget, exclude current page
- Get author meta of all writers
- How to get category pages to look like a certain archive page?
- Display a list of users with avatar filterable with alphabets
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- How to modify this function to exclude also the post belonging to a specific category?
- WP query with variables gives no result for specific user
- a problem in class in class-wp-hook.php
- /page/2/ redirect to 404
- Add adjacent post function inside custom recent post function
- Custom Admin Menu Report for Specific User ID
- How to overwrite youtube embed?
- Generating add_settings_section() calls dynamically
- WP_Query loop, does not display special characters in title correctly
- is_page “range” for if statement?
- Error when adding excerpt to the content through functions.php
- Add data attribute to each li in menu
- Prev/Next child navigation for current page modifications?
- Adding rel tag to all external links
- Unique icons next to each WordPress menu item
- Function works everywhere, how to keep it to execute when creating a new post
- Display an image if odd number of posts in grid
- Pagination broken on is_front_page()
- Why doesn’t PhotoSmash plugin play well with wp_query?
- get_the_ID() doesnt work
- How can I split my query result in 2 arrays?
- How do I check if there is a tag in the title
- the_post(); prints out style text into my HTML?
- Programmatically revert to backup .htaccess a possibility?
- WordPress User Meta value variable into Google Gauge Chart
- Embed video from streamtape using direct link
- Is there a PHP function that will return the block ID generated by WordPress?
- Creating a Function and Call It
- How to display last whole post on the homepage
- Theme editing “post thumbnail” help
- Restrict File Type Uploads by User on Wordress via functions.php
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- AJAX Returning Way Too Many Posts
- Where can I find the declaration of `$_wp_theme_features`?
- redirect 301 with special character like WIX site “#!”
- How I can add div to menu?
- List of child pages fetch next results at link click
- How to print redirected query string variables to the page?
- Admin-area broken through weird issues
- Query Users by post count, last 30 days and display each users post count according to post type
- reorder a WP_Query, using a dropdown
- Custom query_posts() parameter
- Why a class property becomes empty?
- Hide category by tag