This topic has 3 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #11763

    Hi again,

    How can I exclude a user from the members list? I have done this with the admin code included.

    In this line I have included the user ID to exclude but it keeps getting glister in the Quick profile navigation
    $excluded_user=’1,120′;//comma separated ids of users whom you want to exclude

    add_action(‘bp_init’, ‘kleo_private_admin’);
    function kleo_private_admin(){
    global $bp;
    if(is_super_admin())
    {
    remove_action(“wp_head”,”bp_core_record_activity”); //id SM is on, remove the record activity hook
    //then remove the last activity, if present
    delete_user_meta($bp->loggedin_user->id, ‘last_activity’);
    }

    }

    add_action(‘bp_ajax_querystring’,’kleo_exclude_users’,20,2);
    function kleo_exclude_users($qs=false,$object=false)
    {
    //list of users to exclude
    $excluded_user=’1,102′;//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 listing friends?, do not exclude in this case
    if(!empty($args[‘user_id’]))
    return $qs;

    if(!empty($args[‘exclude’]))
    $args[‘exclude’]=$args[‘exclude’].’,’.$excluded_user;
    else
    $args[‘exclude’]=$excluded_user;

    $qs=build_query($args);

    return $qs;
    }

    #12020
     Abe
    Keymaster

    Maybe that user is friend with you and that is why it is not hiding

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #12022

    No I tried a new admin user.

    #12307
     Abe
    Keymaster

    Can’t say. Try just with the new admin and try testing being logged out

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?