本文整理汇总了PHP中bp_get_total_blog_count_for_user函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_total_blog_count_for_user函数的具体用法?PHP bp_get_total_blog_count_for_user怎么用?PHP bp_get_total_blog_count_for_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_total_blog_count_for_user函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_blogs_root_slug
bp_blogs_root_slug();
?>
"><?php
printf(__('All Sites <span>%s</span>', 'buddypress'), bp_get_total_blog_count());
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li id="blogs-personal"><a href="<?php
echo bp_loggedin_user_domain() . bp_get_blogs_slug();
?>
"><?php
printf(__('My Sites <span>%s</span>', 'buddypress'), bp_get_total_blog_count_for_user(bp_loggedin_user_id()));
?>
</a></li>
<?php
}
?>
<?php
do_action('bp_blogs_directory_blog_types');
?>
</ul>
</div><!-- .item-list-tabs -->
<div class="item-list-tabs" id="subnav" role="navigation">
示例2: bp_total_blog_count_for_user
/**
* Output the total number of blogs for a given user.
*
* @param int $user_id ID of the user.
*/
function bp_total_blog_count_for_user($user_id = 0)
{
echo bp_get_total_blog_count_for_user($user_id);
}
示例3: bp_blogs_root_slug
bp_blogs_root_slug();
?>
"><?php
printf(__('All Sites %s', 'buddypress'), '<span>' . bp_get_total_blog_count() . '</span>');
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li id="blogs-personal"><a href="<?php
echo bp_loggedin_user_domain() . bp_get_blogs_slug();
?>
"><?php
printf(__('My Sites %s', 'buddypress'), '<span>' . bp_get_total_blog_count_for_user(bp_loggedin_user_id()) . '</span>');
?>
</a></li>
<?php
}
?>
<?php
/**
* Fires inside the unordered list displaying blog types.
*
* @since 1.2.0
*/
do_action('bp_blogs_directory_blog_types');
?>
示例4: setup_nav
/**
* Set up component navigation for bp-blogs.
*
* @see BP_Component::setup_nav() for a description of arguments.
*
* @param array $main_nav Optional. See BP_Component::setup_nav() for
* description.
* @param array $sub_nav Optional. See BP_Component::setup_nav() for
* description.
*/
public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
$bp = buddypress();
/**
* Blog/post/comment menus should not appear on single WordPress setups.
* Although comments and posts made by users will still show on their
* activity stream.
*/
if ( ! is_multisite() ) {
return false;
}
// Add 'Sites' to the main navigation
$main_nav = array(
'name' => sprintf( __( 'Sites <span>%d</span>', 'buddypress' ), bp_get_total_blog_count_for_user() ),
'slug' => $this->slug,
'position' => 30,
'screen_function' => 'bp_blogs_screen_my_blogs',
'default_subnav_slug' => 'my-sites',
'item_css_id' => $this->id
);
// Determine user to use
if ( bp_displayed_user_domain() ) {
$user_domain = bp_displayed_user_domain();
} elseif ( bp_loggedin_user_domain() ) {
$user_domain = bp_loggedin_user_domain();
} else {
return;
}
$parent_url = trailingslashit( $user_domain . bp_get_blogs_slug() );
$sub_nav[] = array(
'name' => __( 'My Sites', 'buddypress' ),
'slug' => 'my-sites',
'parent_url' => $parent_url,
'parent_slug' => $bp->blogs->slug,
'screen_function' => 'bp_blogs_screen_my_blogs',
'position' => 10
);
// Setup navigation
parent::setup_nav( $main_nav, $sub_nav );
}
示例5: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? 'Blogs' : $instance['title']);
?>
<?php
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<form action="" method="post" id="blogs-directory-form" class="dir-form">
<?php
do_action('bp_before_directory_blogs_content');
?>
<div class="item-list-tabs">
<ul>
<li class="selected menulist" id="blogs-all"><a href="<?php
bp_root_domain();
?>
"><?php
printf(__('All Blogs (%s)', 'buddypress'), bp_get_total_blog_count());
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li class="menulist" id="blogs-personal">
|
<a href="<?php
echo bp_loggedin_user_domain() . BP_BLOGS_SLUG . '/my-blogs/';
?>
"><?php
printf(__('My Blogs (%s)', 'buddypress'), bp_get_total_blog_count_for_user(bp_loggedin_user_id()));
?>
</a>
</li>
<?php
}
?>
<?php
do_action('bp_blogs_directory_blog_types');
?>
<li id="blogs-order-select" class="last filter">
<?php
_e('Order By:', 'buddypress');
?>
<select>
<option value="active"><?php
_e('Last Active', 'buddypress');
?>
</option>
<option value="newest"><?php
_e('Newest', 'buddypress');
?>
</option>
<option value="alphabetical"><?php
_e('Alphabetical', 'buddypress');
?>
</option>
<?php
do_action('bp_blogs_directory_order_options');
?>
</select>
</li>
</ul>
</div>
<div id="blogs-dir-list" class="blogs dir-list">
<?php
locate_template(array('blogs/blogs-loop.php'), true);
?>
</div>
<?php
do_action('bp_after_directory_blogs_content');
?>
<?php
wp_nonce_field('directory_blogs', '_wpnonce-blogs-filter');
?>
</form>
<?php
echo $after_widget;
}
示例6: bp_blogs_root_slug
bp_blogs_root_slug();
?>
"><?php
printf(__('All Sites <span>%s</span>', 'wplms_modern'), bp_get_total_blog_count());
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li id="blogs-personal"><a href="<?php
echo bp_loggedin_user_domain() . bp_get_blogs_slug();
?>
"><?php
printf(__('My Sites <span>%s</span>', 'wplms_modern'), bp_get_total_blog_count_for_user(bp_loggedin_user_id()));
?>
</a></li>
<?php
}
?>
<?php
do_action('bp_blogs_directory_blog_types');
?>
</ul>
</div><!-- .item-list-tabs -->
<?php
if (is_user_logged_in() && bp_blog_signup_enabled() && $flag) {
?>
示例7: setup_nav
/**
* Set up component navigation for bp-blogs.
*
* @see BP_Component::setup_nav() for a description of arguments.
*
* @param array $main_nav Optional. See BP_Component::setup_nav() for
* description.
* @param array $sub_nav Optional. See BP_Component::setup_nav() for
* description.
*/
public function setup_nav($main_nav = array(), $sub_nav = array())
{
/**
* Blog/post/comment menus should not appear on single WordPress setups.
* Although comments and posts made by users will still show on their
* activity stream.
*/
if (!is_multisite()) {
return false;
}
// Determine user to use.
if (bp_displayed_user_domain()) {
$user_domain = bp_displayed_user_domain();
} elseif (bp_loggedin_user_domain()) {
$user_domain = bp_loggedin_user_domain();
} else {
return;
}
$slug = bp_get_blogs_slug();
$parent_url = trailingslashit($user_domain . $slug);
// Add 'Sites' to the main navigation.
$count = (int) bp_get_total_blog_count_for_user();
$class = 0 === $count ? 'no-count' : 'count';
$nav_text = sprintf(__('Sites <span class="%s">%s</span>', 'buddypress'), esc_attr($class), bp_core_number_format($count));
$main_nav = array('name' => $nav_text, 'slug' => $slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-sites', 'item_css_id' => $this->id);
$sub_nav[] = array('name' => __('My Sites', 'buddypress'), 'slug' => 'my-sites', 'parent_url' => $parent_url, 'parent_slug' => $slug, 'screen_function' => 'bp_blogs_screen_my_blogs', 'position' => 10);
// Setup navigation.
parent::setup_nav($main_nav, $sub_nav);
}
示例8: bp_root_domain
<li class="selected" id="blogs-all"><a href="<?php
bp_root_domain();
?>
"><?php
printf(__('All Blogs <span class="badge">%s</span>', 'buddypress'), bp_get_total_blog_count());
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li id="blogs-personal"><a href="<?php
echo bp_loggedin_user_domain() . BP_BLOGS_SLUG . '/my-blogs/';
?>
"><?php
printf(__('My Blogs <span class="badge">%s</span>', 'buddypress'), bp_get_total_blog_count_for_user(bp_loggedin_user_id()));
?>
</a></li>
<?php
}
?>
<?php
do_action('bp_blogs_directory_blog_types');
?>
<li id="blogs-order-select" class="last filter">
<?php
_e('Order By:', 'buddypress');
?>
示例9: bp_root_domain
<li class="selected" id="blogs-all"><a href="<?php
bp_root_domain();
?>
"><?php
printf(__('All Blogs (%s)', 'buddypress'), bp_get_total_blog_count());
?>
</a></li>
<?php
if (is_user_logged_in() && bp_get_total_blog_count_for_user(bp_loggedin_user_id())) {
?>
<li id="blogs-personal"><a href="<?php
echo bp_loggedin_user_domain() . BP_BLOGS_SLUG . '/my-blogs/';
?>
"><?php
printf(__('My Blogs (%s)', 'buddypress'), bp_get_total_blog_count_for_user(bp_loggedin_user_id()));
?>
</a></li>
<?php
}
?>
<?php
do_action('bp_blogs_directory_blog_types');
?>
<li id="blogs-order-select" class="last filter">
<?php
_e('Order By:', 'buddypress');
?>