Hide some users  


sunny
Posts: 42
(@sunny)
Eminent Member
Joined: 2 years ago

Hello, is it possible to hide some users from user list based on usermeta values? For example I would like to hide all users whose usermeta value is user_disabled=1. How can I do that?

4 Replies
Astghik
Posts: 3480
Admin
(@astghik)
Support Team
Joined: 2 years ago

Hi @sunny,

The wpDiscuz User & Comment Mentioning add-on has the following filter you can use for this purpose:

$users = apply_filters('wpdumc_user_search_result', $users, $postID, $ch_user);
Reply
sunny
Posts: 42
(@sunny)
Eminent Member
Joined: 2 years ago

hi @astghik, do you have some documentation or usage example on how it should be used in functions.php?

Reply
1 Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 3480

@sunny,

I'm really sorry, but there is no documentation or usage example.

Yes, you should add the custom code in functions.php file. 

Reply
aorchard
Posts: 13
Customer
(@aorchard)
Member
Joined: 1 year ago

I second this question, but would appreciate an actual answer that shows what to do

$users = apply_filters('wpdumc_user_search_result', $users, $postID, $ch_user);

where can we add in the usernames we want to exclude in this code?

Reply
Share:
Green
Default
Pear
Black Emo
{green}:grinning:
{green}:wink:
{green}:face:
{green}:inlove:
{green}:sweaty:
{green}:surprised:
{green}:lovekiss:
{green}:laugh:
{green}:formalsmile:
{green}:displeased:
{green}:cool:
{green}:resent:
{green}:nerd:
{green}:screaming:
{green}:amazed:
{green}:sad:
{green}:deceitful:
{green}:starryeyes:
{green}:evil:
{green}:shocked:
{green}:tears:
{green}:sulky:
{green}:smile:
{green}:vomited:
{green}:hi:
{green}:afraid:
{green}:crazy:
{green}:rabid:
{green}:fighting:
{green}:nonoise:
{green}:blushed:
{green}:idontknow:
{green}:scared:
{green}:razz:
{green}:kiss:
{green}:eat:
{green}:shutmouth:
{green}:gape:
{green}:suspicious:
{green}:laughingoutloud:
{green}:bruise:
{green}:crying:
{green}:pray:
{green}:serious:
{green}:excitement:
:)
:d
:wink:
:mrgreen:
:neutral:
:twisted:
:arrow:
:shock:
:???:
:cool:
:evil:
:oops:
:razz:
:roll:
:cry:
:eek:
:lol:
:mad:
:sad:
:!:
:?:
:idea:
:hmm:
:beg:
:whew:
:chuckle:
:silly:
:envy:
:shutmouth:
{pear}:happy:
{pear}:smile:
{pear}:laugh:
{pear}:laughingoutloud:
{pear}:crying:
{pear}:exhausted:
{pear}:nerd:
{pear}:surprised:
{pear}:veryhungry:
{pear}:wink:
{blackemo}:laughtertotears:
{blackemo}:gift:
{blackemo}:love:
{blackemo}:inlove:
{blackemo}:shamefaced:
{blackemo}:heart:
{blackemo}:crazy:
{blackemo}:anguished:
{blackemo}:bruise:
{blackemo}:easymoney:
{blackemo}:exhausted:
{blackemo}:vampire:
{blackemo}:shutmouth:
{blackemo}:wink:
{blackemo}:carnival:
{blackemo}:flowers:
{blackemo}:hotdrink:
{blackemo}:party: