1

I have a block system to make users block each other, My question is how to get all users by current user meta by the array?

When current user is blocked anther user it's saved as meta like this: a:1:{i:0;s:1:"3";} so user id 1 block user id 3

So I need to make a specific page to get all users that current user is blocked by checking current user meta 'blocking_users' to get the blocked users from it.

I found this topic: https://mattvarone.com/wordpress/list-users-with-wp_user_query/ but i can't make it working.

1 Answer 1

-1

This function will give you the ids of blocked users

get_user_meta( $user_id, '_block', true );

here $user_id is yours

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.