Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create Select with forums dependig the user


  • akenach
    Participant

    @akenach

    Hi Folks

    i have more forums but only need show the forums by groups created by Buddypress, this is my code, only apears One course, can somebody help me?

    add_shortcode( 'DASH_forums', 'DASH_forums_func' );
    function DASH_forums_func() {
      $group_ids = groups_get_user_groups(bp_loggedin_user_id());
      foreach($group_ids["groups"] as $group_id) {
        $nombregrupo = groups_get_group(array( 'group_id' => $group_id )) -> name;
        $descripciongrupo = groups_get_group(array( 'group_id' => $group_id )) -> description;
    
        $html .= '<div id="enlacecurso"><a href="' . home_url() . '/groups/' . $nombregrupo . '/forum">' . $nombregrupo  . ' Group Forum</a>' . (end($group_ids["groups"]) == $group_id ? '' : '' ) ;
        $html .= '</div>';
        return $html;
      }
    }
  • You must be logged in to reply to this topic.
Skip to toolbar