本文整理汇总了PHP中bp_get_forums_slug函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_forums_slug函数的具体用法?PHP bp_get_forums_slug怎么用?PHP bp_get_forums_slug使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_forums_slug函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_forums_slug
/**
* Output the forums component slug.
*
* @since BuddyPress (1.5.0)
*
* @uses bp_get_forums_slug()
*/
function bp_forums_slug()
{
echo bp_get_forums_slug();
}
示例2: trailingslashit
<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>
示例3: setup_admin_bar
/**
* 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);
}