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)?
- Filtering a function’ output for a new continued function
- Get html data with javascript to php array and store to wordpress database
- How do I create a numbered list with PHP? [closed]
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Countdown to date function?
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- How to get the last category name of a child category?
- How to say if meta_value is greater than 0 in an array?
- Getting users with a specific meta data and then querying their posts?
- How to use two meta_compare in an array?
- How to update and save user metadata on page visits?
- Warning: in_array() null given in PHP function
- Foreach loop inside an array_merge
- Login redirect. Check user meta and redirect accordingly
- Loop over Array and get the distinct ids
- How to access or parse key/values that have “string”
- User Meta Value not echoing despite Var_Dump Showing correct string
- Remove empty terms from array, sort alphabetically, update back to repeating field
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- Shortcode for Listing Users from Meta Value?
- Conditional multidimensional arrays and array_map
- Getting different user data depending on where I use variable
- How can I get all values from my array in a loop in php? [closed]
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- Adding Author Box Meta Links with Co-Authors
- 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
- Get the users that my following users are following
- extract serialized array to use for wp-query
- get users search not working with array
- Get the id of all images in a post
- Output category list inside array
- how to make an array of post id’s in is_single
- How can I split my query result in 2 arrays?
- Multidimensional Array
- Separate array output into a
- array_rand not working correctly?
- Get css class of menu item in custom menu structure
- Dynamically adding filters
- Order a WP_Query by meta value where the value is an array
- Edit Account – read and write to MySQL
- 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
- How to make sure relative URL works when site is not on root domain?
- Get URI from PodPress using PHP
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- using images in next/previous_post_link [closed]
- Finding and removing duplicates within WP Arrays
- Using multiple variables to assign categories to an array
- Uses for function: wp_update_user
- Custom functions for string data calculations
- Add custom fields from different posts
- Update user repeater meta (ACF) with another user meta field value
- Create condition for Author bio Social Links
- Repeat a function with 24hrs gap for n number of days
- MySQL Query Returns Array () In Shortcode
- How to store checkbox data for individual users?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Convert a column of a table containing an Array as response in HTML
- How do I Populate a Table Field with User Meta Data?
- Sending simple variable on single page to WP JSON
- 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?
- Order users by random not working?
- Redux option doensn’t seem when include from functions.php
- How to add and subtract user meta values after post meta update
- in_array not working on dev server but works on localhost
- User meta needed in query is serialized – how to unserialize safely?
- Include User ID in iFrame URL
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Usermeta data unserialize, extract and display in table in WordPress
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- how to separate an array into different arrays and save them into db?
- 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
- How to display MySQL table data which is stored as an array?
- Store data from JavaScript object to custom table in user account
- ACF – Get ID of relationship field in flexible content
- Export WordPress User Meta to CSV/Excel
- Updating User Profile information removes image
- Replace an array (with identical values) with another array in the_content
- How to change the value of a variable using input field?
- Display current user metadata on WordPress page
- Show the subcategory name based on current product
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Get user by meta data key and velue
- How to filter specific element of an array in wordpress/php?
- Where do I implement this display of User Meta Data, and how to put it in a table?
- WP post meta – for loop inside for loop