/** * Output the forums component slug. * * @since BuddyPress (1.5.0) * * @uses bp_get_forums_slug() */ function bp_forums_slug() { echo bp_get_forums_slug(); }
<div class="item-list-tabs" role="navigation"> <ul> <li class="selected" id="forums-all"><a href="<?php echo trailingslashit(bp_get_root_domain() . '/' . bp_get_forums_root_slug()); ?> "><?php printf(__('All Topics <span>%s</span>', 'buddypress'), bp_get_forum_topic_count()); ?> </a></li> <?php if (is_user_logged_in() && bp_get_forum_topic_count_for_user(bp_loggedin_user_id())) { ?> <li id="forums-personal"><a href="<?php echo trailingslashit(bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics'); ?> "><?php printf(__('My Topics <span>%s</span>', 'buddypress'), bp_get_forum_topic_count_for_user(bp_loggedin_user_id())); ?> </a></li> <?php } ?> <?php do_action('bp_forums_directory_group_types'); ?> </ul>
/** * Set up bp-forums integration with the WordPress admin bar. * * @since 1.5.0 * * @see BP_Component::setup_admin_bar() for a description of arguments. * * @param array $wp_admin_nav See BP_Component::setup_admin_bar() * for description. */ public function setup_admin_bar($wp_admin_nav = array()) { // Menus for logged in user. if (is_user_logged_in()) { // Setup the logged in user variables. $forums_link = trailingslashit(bp_loggedin_user_domain() . bp_get_forums_slug()); // Add the "My Account" sub menus. $wp_admin_nav[] = array('parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __('Forums', 'buddypress'), 'href' => $forums_link); // Topics. $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-topics-started', 'title' => __('Topics Started', 'buddypress'), 'href' => $forums_link); // Replies. $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-replies', 'title' => __('Replies', 'buddypress'), 'href' => trailingslashit($forums_link . 'replies')); // Favorites. $wp_admin_nav[] = array('parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-favorite-topics', 'title' => __('Favorite Topics', 'buddypress'), 'href' => trailingslashit($forums_link . 'favorites')); } parent::setup_admin_bar($wp_admin_nav); }