You can achieve this using get_users function and its meta_key argument as displayed below.
$users = get_users(array(
'meta_key' => 'blocking_users',
));
var_dump( $users );
To retrieve it for current user and print it, please use below code.
$user_id = get_current_user_id();
$key = 'blocking_users';
$single = false;
$blocking_users = get_user_meta( $user_id, $key, $single );
echo '<p>The '. $key . ' value for user id ' . $user_id . ' is: </p>';
print_r($blocking_users);
Related Posts:
- If Array Values Match Another Array’s Values, Then
- Comapare get_user_meta value
- Store custom field’s multiple values in one user meta key
- get_users when from meta key that has serialized values
- How can get all users by current user meta (array)?
- Metabox repeating fields – radio buttons not saving correctly
- How can merge two arrays values in one array and save in database
- Calling a method from functions.php on a click of a button
- Showing user ID on user main page from screen options
- Error in WP_update_post
- Compare two meta key values against each other inside the get_posts array?
- Looping through WP_Post Object
- Using a javascript file to access a get posts array
- Generate an array of parent/child page IDs, based on parent page name
- How do I output a database option that is an array into a get_posts array?
- Issue with foreach on duplicate meta_key’s
- get_usermeta() deprecated in favor of get_user_meta(). But why doesn’t it make use of it?
- Can an array be used as a meta_query value?
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- List of posts by day of the week
- Check if term object is in array
- How to display user nickname (not display name) in PHP template?
- Create a new usermeta field for users
- How to get a list of all possible values of a specific user meta key?
- Create shortcodes within foreach loop (using array)
- How do I display a user’s previous orders as a select box option on a product?
- Using a variable in is_page(array())
- Remove duplicates – array_unique()
- Recent posts with featured image or fallback image with permalink
- Storing Array from returned database query and using the array in a new query
- How to use an associative array in post__in with WP_Query?
- get_*_meta doesn’t always return an array
- get_the_tags() not iterating through for/while loop, but will with foreach
- get a simple array of all of the term names that exist in all taxonomies
- How to use $query->set with post__in?
- function to assign user role based on a field from usermeta
- Reprinting tags with all attributes
- Creating user status mode in WordPress
- Adding number to date not working [closed]
- Exclude posts based on meta value
- Checking array against author id in loop
- a:0:{} is replaced into database as s:6:”a:0:{}”;
- Advanced Custom Fields – display label and value only if value entered
- Grouping posts by a custom meta value
- wp_force_remove_style’ not found
- Read array in php?
- How can I access string value in an array?
- Filtering a function’ output for a new continued function
- Error while setting role
- How to say if meta_value is greater than 0 in an array?
- Loop over Array and get the distinct ids
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Only show first image in foreach loop
- Shortcode for Listing Users from Meta Value?
- How can I get all values from my array in a loop in php? [closed]
- Get all posts as an array ID => Name
- I’m unable to call img path using single quotes in an array?
- Filter by field with array value in ACF on WP REST API
- Separate array output into a
- Only load certain artists on this page
- add the value of a variable returned in a while loop [closed]
- Update value of a associative array with update_post_meta
- using images in next/previous_post_link [closed]
- Uses for function: wp_update_user
- Update user repeater meta (ACF) with another user meta field value
- MySQL Query Returns Array () In Shortcode
- How to store checkbox data for individual users?
- Convert a column of a table containing an Array as response in HTML
- Create an array with all the links of the years’ archive (of a custom post type)
- Display just one post from a loop of 5 posts?
- Redux option doensn’t seem when include from functions.php
- User meta needed in query is serialized – how to unserialize safely?
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Change user metadata on registration (show_admin_bar_front = false)
- How to insert multiple rows and columns in database using array
- Display one random image from Media Library
- ACF – Get ID of relationship field in flexible content
- Replace an array (with identical values) with another array in the_content
- Display current user metadata on WordPress page
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Get user by meta data key and velue
- Update an additional user meta field with a string
- get_category_parents to array
- Add another role to a user when they click a button?
- Right way to display the_author_meta fields?
- Adding user meta to post meta wp_insert_post() not working
- How can i iterate through this shortcode array?
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Non-array argument in array_merge()-function [closed]
- Unserializeing multiple column values that are stored in one database results variable
- How to get values from wordpress listings and use them in javascript array?
- Repeatable field within repeatable group of fields
- get_permalink returning first letter
- Showing all post from all post type in admin backstage
- Use php array outside his function
- Retrieve Array from within Array [closed]
- save array of objects with update_option
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Replace block content with an array
- Adding date and time to the same request