Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_parse_args() to filter members based on wordpress role


  • tolisp
    Participant

    @tolisp

    Hi everyone, i am trying to filter the members loop in order to display only the members that belong to specific roles in wp. I looked up the codex and found the bp_parse_args() and tried to do this

    function my_bp_members_roles( $retval ) {
         $retval['meta_key'] = 'role';
         $retval['meta_value'] = 'member';
         
         $retval['meta_key'] = 'role';
         $retval['meta_value'] = 'staff';
     
        return $retval;
    }
    add_filter( 'bp_after_has_members_parse_args', 'my_bp_members_roles' );

    but unsuccesfully 🙁

    Any idea what am i doing wrong?

    Thanks
    Tolis

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bp_parse_args() to filter members based on wordpress role’ is closed to new replies.
Skip to toolbar