This topic has 2 replies, 3 voices, and was last updated 9 years by Radu.

  • Author
  • #140728
     mlvc1958
    Participant

    Hi i want to hide admins from all members but not other Admins.

    add_action(‘bp_ajax_querystring’,‘sq7_radu_exclude_users’,20,2);
    function sq7_radu_exclude_users($qs=false,$object=false){
        //list of users to exclude
        $excluded_user = ‘1’;//comma separated ids of users whom you want to exclude
        if($object!=‘members’)//hide for members only
            return $qs;
        $args=wp_parse_args($qs);
        //check if we are searching for friends list etc?, do not exclude in this case
        if(!empty($args[‘user_id’])||!empty($args[‘search_terms’]))
            return $qs;
        if(!empty($args[‘exclude’]))
            $args[‘exclude’]=$args[‘exclude’].‘,’.$excluded_user;
        else
            $args[‘exclude’]=$excluded_user;
        $qs=build_query($args);
        return $qs;
    }

     

    could you tweak the code so this is achievable?

    #140902
     Laura
    Moderator
    Not marked as solution
    #140972
     Radu
    Moderator
    Not marked as solution
Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?