BP_Forums_Component:: setup_nav (main_nav美元=数组(),sub_nav美元=数组())
设置BuddyBar导航
描述
源
文件:bp-forums /类/ class-bp-forums-component.php
public function setup_nav($main_nav = array(), $sub_nav = array()){//如果没有用户显示或登录将停止if (!is_user_logged_in() && !bp_displayed_user_id())返回;//定义本地变量$user_domain = ";//添加论坛到主导航$main_nav = array('name' => __('Forums', 'buddyboss'), 'slug' => $this->slug, 'position' => 80, 'screen_function' => 'bbp_member_forums_screen_topics', 'default_subnav_slug' => bbp_get_topic_archive_slug(), 'item_css_id' => $this->id);//判断用户是否使用if (bp_displayed_user_id()) $user_domain = bp_displayed_user_domain();Elseif (bp_loggedin_user_domain()) $user_domain = bp_loggedin_user_domain();其他的回报;//用户链接$forums_link = trailingslashit($user_domain。$ this - >蛞蝓);$sub_nav[] = array('name' => __('My Discussions', 'buddyboss'), 'slug' => bbp_get_topic_archive_slug(), 'parent_url' => $forums_link, 'parent_slug' => $this->slug, 'screen_function' => 'bbp_member_forums_screen_topics', 'position' => 20, 'item_css_id' => ' Topics ');$sub_nav[] = array('name' => __('My Replies', 'buddyboss'), 'slug' => bbp_get_reply_archive_slug(), 'parent_url' => $forums_link, 'parent_slug' => $this->slug, 'screen_function' => 'bbp_member_forums_screen_replies', 'position' => 40, 'item_css_id' => ' Replies'); // Favorite topics $sub_nav[] = array( 'name' => __( 'My Favorites', 'buddyboss' ), 'slug' => bbp_get_user_favorites_slug(), 'parent_url' => $forums_link, 'parent_slug' => $this->slug, 'screen_function' => 'bbp_member_forums_screen_favorites', 'position' => 60, 'item_css_id' => 'favorites' ); // Subscribed topics (my profile only) if ( bp_is_my_profile() ) { $sub_nav[] = array( 'name' => __( 'Subscriptions', 'buddyboss' ), 'slug' => bbp_get_user_subscriptions_slug(), 'parent_url' => $forums_link, 'parent_slug' => $this->slug, 'screen_function' => 'bbp_member_forums_screen_subscriptions', 'position' => 60, 'item_css_id' => 'subscriptions' ); } parent::setup_nav( $main_nav, $sub_nav ); }
更新日志
版本 | 描述 |
---|---|
bbPress (r3552) | 介绍了。 |