WordPress.org

Ready to get started?Download WordPress

Forums

Bowe Codes
[resolved] Hide Group Admins from Member display (2 posts)

  1. KNetwalker
    Member
    Posted 1 year ago #

    I am using this shortcode [bc_group_users amount="20" slug="honey-badgers"] and want to show members, but not show group admins. Is there a shortcode modification I can use?

    http://wordpress.org/extend/plugins/bowe-codes/

  2. imath
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @KNetwalker

    You have 2 options.

    1/ edit bowe-codes.php at line 319
    by replacing exclude_admins_mods=0
    with exclude_admins_mods=1

    The trouble with this solution is that all groups wont show the admin or mods of the group.

    2/ use a filter : that's the solution i may use on the plugin for an eventual upgrade..
    at line 318 insert :

    $group_admins_mods_show = apply_filters('bowe_codes_group_users_tag_admin_mods_show', 0, $group_data->id);

    Edit line 319 that should be 322 after you inserted the code above
    by replacing exclude_admins_mods=0
    with exclude_admins_mods='.$group_admins_mods_show.'

    Then in the functions.php of your active theme :

    add_filter('bowe_codes_group_users_tag_admin_mods_show', 'knetwalker_hide_admins', 10, 2);
    
    function knetwalker_hide_admins( $show, $group_id) {
        /*then you can use an array for instance to store the group_ids
         where you dont want the admins/mods to appear */
    
        $group_array = array( 1, 2, 3);
    
        if( in_array( $group_id, $group_array) )
            return 1;
    
        else return $show;
    }

    this way you can sets group admins visibility on a group basis..

    Bye

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic