bp_nouveau_customizer_group_nav :: setup_nav()

仅使用所需参数设置临时导航。

描述

来源

文件:bp-templates / bp-nouveau /包括/ groups / classes.php

受保护的函数setup_nav(){$ nav_items = array('root'=>数组('name'=> __('我的群组','buddyboss'),'slug'=> $ this-> group-> slug,'位置'=> -1,/ **此过滤器被记录在BP-Groups / classes / class-bp-groups-component.php中。* /'default_subnav_slug'=> apply_filters('bp_groups_default_extension',定义('bp_groups_default_extension')?bp_groups_default_extension:'home'),),'成员'=>数组('name'=> __('成员','buddyboss'),'slug'=>'成员','parent_slug'= >> $ this->组 - > slug,'位置'=> 10,),'invites'=>数组('name'=> __('发送邀请','buddyboss'),'slug'=>'send-invites','parent_slug'=> $ this-> group-> slug,'位置'=> 70,),'manage'=>数组('name'=> __('manage','buddyboss'),'slug'=>'admin','parent_slug'=> $ this-> group-> slug,'位置'=> 1000,),);if(bp_is_active('论坛')&& function_exists('bbp_is_group_forums_active')){if(bbp_is_group_forums_active()){$ nav_items ['forum'] = array('name'=> __('讨论','buddyboss'),'slug'=> get_option('_bbp_forum_slug','forum'),'parent_slug'=> $ this-> group-> slug,'位置'=> 30,);}}如果(bp_enable_group_hierarchies()){$ nav_items ['子组'] =数组('name'=> __('子组','buddyboss'),'slug'=>'子组','parent_slug'=> $这个 - > group-> slug,'位置'=> 30,);}如果(function_exists('bp_ld_sync')){$ va = bp_ld_sync('settings') - > get('buddypress.enabled',true);if('1'=== $ va){$ nav_items ['courses'] =数组('name'=> __('课程','buddyboss'),'slug'=>'courses','parent_slug','parent_slug'=> $ this-> group-> slug,'位置'=> 40,); } } if ( function_exists( 'bp_ld_sync' ) ) { $va = bp_ld_sync( 'settings' )->get( 'reports.enabled', true ); if ( '1' === $va ) { $nav_items['reports'] = array( 'name' => __( 'Reports', 'buddyboss' ), 'slug' => 'reports', 'parent_slug' => $this->group->slug, 'position' => 40, ); } } if ( bp_is_active( 'activity' ) ) { $nav_items['activity'] = array( 'name' => __( 'Feed', 'buddyboss' ), 'slug' => 'activity', 'parent_slug' => $this->group->slug, 'position' => 20, ); } // Required params $required_params = array( 'slug' => true, 'name' => true, 'nav_item_position' => true, ); // Now find nav items plugins are creating within their Group extensions! foreach ( get_declared_classes() as $class ) { if ( is_subclass_of( $class, 'BP_Group_Extension' ) ) { $extension = new $class; if ( ! empty( $extension->params ) && ! array_diff_key( $required_params, $extension->params ) ) { $nav_items[ $extension->params['slug'] ] = array( 'name' => $extension->params['name'], 'slug' => $extension->params['slug'], 'parent_slug' => $this->group->slug, 'position' => $extension->params['nav_item_position'], ); } } } // Now we got all, create the temporary nav. foreach ( $nav_items as $nav_item ) { $this->add_nav( $nav_item ); } }

变更乐

变更乐
版本 描述
BuddyPress 3.0.0 介绍。

问题?

我们总是很乐意帮助您可能拥有的代码或其他问题!搜索我们开发人员文档联系支持,或与我们联系销售团队