本文整理汇总了PHP中BP_Component::setup_title方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Component::setup_title方法的具体用法?PHP BP_Component::setup_title怎么用?PHP BP_Component::setup_title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Component
的用法示例。
在下文中一共展示了BP_Component::setup_title方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup_title
/**
* Set up the title for pages and <title>.
*/
public function setup_title()
{
$bp = buddypress();
if (bp_is_my_profile()) {
$bp->bp_options_title = __('You', 'buddypress');
} elseif (bp_is_user()) {
$bp->bp_options_title = bp_get_displayed_user_fullname();
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), $bp->bp_options_title)));
}
parent::setup_title();
}
示例2:
/**
* Sets up the title for pages and <title>
*
* @global obj $bp
*/
function setup_title()
{
global $bp;
if (bp_is_messages_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('My Messages', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
}
}
parent::setup_title();
}
示例3: elseif
/**
* Sets up the title for pages and <title>
*
* @global obj $bp
*/
function setup_title()
{
global $bp;
if (bp_is_my_profile()) {
$bp->bp_options_title = __('You', 'buddypress');
} elseif (bp_is_user()) {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
}
parent::setup_title();
}
示例4: setup_title
/**
* Set up the title for pages and <title>.
*
* @since 1.9.0
*/
public function setup_title()
{
// Adjust title.
if (bp_is_notifications_component()) {
$bp = buddypress();
if (bp_is_my_profile()) {
$bp->bp_options_title = __('Notifications', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例5: setup_title
/**
* Setup title for various screens
*
*/
public function setup_title()
{
parent::setup_title();
}
示例6: setup_title
/**
* Set up the title for pages and <title>.
*/
public function setup_title()
{
if (bp_is_groups_component()) {
$bp = buddypress();
if (bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_title = _x('Memberships', 'My Groups page <title>', 'buddypress');
} elseif (!bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
// We are viewing a single group, so set up the
// group navigation menu using the $this->current_group global.
} elseif (bp_is_single_item()) {
$bp->bp_options_title = $this->current_group->name;
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $this->current_group->id, 'object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'alt' => __('Group Profile Photo', 'buddypress')));
if (empty($bp->bp_options_avatar)) {
$bp->bp_options_avatar = '<img src="' . esc_url(bp_core_avatar_default_thumb()) . '" alt="' . esc_attr__('No Group Profile Photo', 'buddypress') . '" class="avatar" />';
}
}
}
parent::setup_title();
}
示例7: setup_title
/**
* Sets up the title for pages and <title>
*
* @global BuddyPress $bp The one true BuddyPress instance
*/
public function setup_title()
{
$bp = buddypress();
if (bp_is_buddyblog_component()) {
if (bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_title = __('Posts', 'buddyblog');
} elseif (!bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddyblog'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
// We are viewing a single group, so set up the
// group navigation menu using the $this->current_group global.
}
}
parent::setup_title();
}
示例8: setup_title
/**
* Set up the title for pages and <title>.
*
* @since BuddyPress (1.5.0)
*
* @uses bp_is_activity_component()
* @uses bp_is_my_profile()
* @uses bp_core_fetch_avatar()
*/
public function setup_title()
{
$bp = buddypress();
// Adjust title based on view
if (bp_is_activity_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = _x('My Activity', 'Page and <title>', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例9: sprintf
/**
* Sets up the title for pages and <title>
*
* @global BuddyPress $bp The one true BuddyPress instance
*/
function setup_title()
{
global $bp;
// Adjust title
if (bp_is_friends_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('Friendships', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例10:
/**
* Sets up the title for pages and <title>
*
* @since 1.5.0
*
* @global object $bp BuddyPress global settings
* @uses bp_is_activity_component()
* @uses bp_is_my_profile()
* @uses bp_core_fetch_avatar()
*/
function setup_title()
{
global $bp;
// Adjust title based on view
if (bp_is_activity_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('My Activity', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
}
}
parent::setup_title();
}
示例11: setup_title
/**
* Set up the title for pages and <title>
*/
public function setup_title() {
$bp = buddypress();
// Set up the component options navigation for Site
if ( bp_is_blogs_component() ) {
if ( bp_is_my_profile() ) {
if ( bp_is_active( 'xprofile' ) ) {
$bp->bp_options_title = __( 'My Sites', 'buddypress' );
}
// If we are not viewing the logged in user, set up the current
// users avatar and name
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar( array(
'item_id' => bp_displayed_user_id(),
'type' => 'thumb',
'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
) );
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例12: setup_title
/**
* Sets up the title for pages and <title>
*
* @since bbPress (r3552)
*/
public function setup_title()
{
$bp = buddypress();
// Adjust title based on view
if (bp_is_forums_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('Forums', 'bbpress');
} elseif (bp_is_user()) {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb'));
$bp->bp_options_title = bp_get_displayed_user_fullname();
}
}
parent::setup_title();
}
示例13:
/**
* Sets up the title for pages and <title>
*
* @global obj $bp
*/
function setup_title()
{
global $bp;
// Set up the component options navigation for Blog
if (bp_is_blogs_component()) {
if (bp_is_my_profile()) {
if (bp_is_active('xprofile')) {
$bp->bp_options_title = __('My Sites', 'buddypress');
}
// If we are not viewing the logged in user, set up the current
// users avatar and name
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
}
}
parent::setup_title();
}
示例14:
/**
* Sets up the title for pages and <title>
*
* @global obj $bp
*/
function setup_title()
{
global $bp;
if (bp_is_groups_component()) {
if (bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_title = __('Memberships', 'buddypress');
} else {
if (!bp_is_my_profile() && !bp_is_single_item()) {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
// We are viewing a single group, so set up the
// group navigation menu using the $this->current_group global.
} else {
if (bp_is_single_item()) {
$bp->bp_options_title = $this->current_group->name;
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $this->current_group->id, 'object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'alt' => __('Group Avatar', 'buddypress')));
if (empty($bp->bp_options_avatar)) {
$bp->bp_options_avatar = '<img src="' . esc_attr($group->avatar_full) . '" class="avatar" alt="' . esc_attr($group->name) . '" />';
}
}
}
}
}
parent::setup_title();
}
示例15:
/**
* Sets up the title for pages and <title>
*
* @global obj $bp
*/
function setup_title()
{
global $bp;
// Adjust title
if (bp_is_friends_component()) {
if (bp_is_my_profile()) {
$bp->bp_options_title = __('Friendships', 'buddypress');
} else {
$bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb'));
$bp->bp_options_title = $bp->displayed_user->fullname;
}
}
parent::setup_title();
}