Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 显示公共、私人和私人的单独选项卡;Buddypress中的隐藏群_Php_Wordpress - Fatal编程技术网

Php 显示公共、私人和私人的单独选项卡;Buddypress中的隐藏群

Php 显示公共、私人和私人的单独选项卡;Buddypress中的隐藏群,php,wordpress,Php,Wordpress,我是wordpress&buddypress的新手。我想知道如何在显示所有组的“组”部分中为用户显示公用、专用和隐藏组的单独选项卡。有一个函数bp\u get\u total\u group\u count()。可能需要使用一些apply_filter的东西,但我不确定 请帮忙 如果需要,我可以向您提供代码。谢谢。经过一番挖掘后找到了答案。这是: 该过程用于单独显示私有组,对于公共组和隐藏组,遵循相同的过程 1。在bp-groups/bp-groups-template.php的函数bp\u h

我是wordpress&buddypress的新手。我想知道如何在显示所有组的“组”部分中为用户显示公用、专用和隐藏组的单独选项卡。有一个函数
bp\u get\u total\u group\u count()。可能需要使用一些
apply_filter
的东西,但我不确定

请帮忙


如果需要,我可以向您提供代码。谢谢。

经过一番挖掘后找到了答案。这是: 该过程用于单独显示私有组,对于公共组和隐藏组,遵循相同的过程

1。在bp-groups/bp-groups-template.php的函数bp\u has\u groups下,添加以下行:

elseif('anything'=$bp->current_action){ $type='anything';}

2.在bp-groups/bp-groups-loader.php的函数setup\u nav下,添加一个nav项:

$sub_nav[]=阵列(

3.在bp default/members/single/groups.php中,如果出现以下情况,则向当前添加一个else:

elseif(bp是当前动作(“任何”):

do_action('bp_before_member_groups_content');?>
/ 

此时没有可用的选项

就是这样。对公共组和隐藏组也一样,更改“任何”的值

        'name'            => __( 'Private', 'buddypress' ),
        'slug'            => 'anything',
        'parent_url'      => $groups_link,
        'parent_slug'     => $this->slug,
        'screen_function' => 'groups_screen_my_groups',
        'position'        => 20,
        'user_has_access' =>  bp_is_my_profile(),
 );
     do_action( 'bp_before_member_groups_content' ); ?> 
     <?php locate_template( array( 'members/single/groups/anything.php' ), true ); ?>
     <?php do_action( 'bp_after_member_groups_content' ); 
  <li id="field_reg_groups_<?php echo $i; ?>" name="field_reg_groups[]" value="<?php bp_group_id(); ?>" />
    <?php bp_group_name(); ?>
  <div class="item-avatar">
    <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
  </div>

  <div class="item">
      <div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>

      <div class="item-meta">
       <span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
      </div>

      <div class="item-desc"><?php bp_group_description_excerpt(); ?>
      </div>

       <?php do_action( 'bp_directory_groups_item' ); ?>

  </div>

  <div class="action">

     <?php do_action( 'bp_directory_groups_actions' ); ?>

    <div class="meta">

       <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?>

    </div>

  </div>

  <div class="clear"></div>
   </li>


   <?php } 
   $i++; 
   endwhile; 
   endif; 
   else: ?>
   <p class="reg_groups_none">No selections are available at this time.</p>