从buddypress隐藏特定成员?

时间:2019-06-26 13:14:45

标签: php wordpress buddypress

我想在Buddypress中隐藏一些特定成员。 到目前为止,我已经尝试过(NetSh interface set interface name="Ethernet" newname="LAN" ):

bp-custom.php

但是,此代码无法正常工作。我已经尝试过

// Remove admin from the member directory
function bpdev_exclude_users($qs=false,$object=false){

    $excluded_user='1'; // Id's to remove, separated by comma

    if($object != 'members' && $object != 'friends')// hide admin to members & friends 
    return $qs;

    $args=wp_parse_args($qs);

    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;

}
add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);

// once admin is removed, we must recount the members !
function bpfr_hide_get_total_filter($count){
    return $count-1;
}
add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
  

我的BuddyPress版本为:4.3.0,而WordPress版本为:5.2.2

Reference

0 个答案:

没有答案