當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Component::setup_title方法代碼示例

本文整理匯總了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();
 }
開發者ID:sdh100shaun,項目名稱:pantheon,代碼行數:14,代碼來源:bp-members-loader.php

示例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();
 }
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:18,代碼來源:bp-messages-loader.php

示例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();
 }
開發者ID:newington,項目名稱:buddypress,代碼行數:16,代碼來源:bp-members-loader.php

示例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();
 }
開發者ID:igniterealtime,項目名稱:community-plugins,代碼行數:19,代碼來源:class-bp-notifications-component.php

示例5: setup_title

 /**
  * Setup title for various screens
  * 
  */
 public function setup_title()
 {
     parent::setup_title();
 }
開發者ID:Kemitestech,項目名稱:WordPress-Skeleton,代碼行數:8,代碼來源:mpp-bp-component.php

示例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();
 }
開發者ID:JeroenNouws,項目名稱:BuddyPress,代碼行數:24,代碼來源:bp-groups-loader.php

示例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();
 }
開發者ID:poweronio,項目名稱:mbsite,代碼行數:20,代碼來源:buddyblog-loader.php

示例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();
 }
開發者ID:kosir,項目名稱:thatcamp-org,代碼行數:23,代碼來源:bp-activity-loader.php

示例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();
 }
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:19,代碼來源:bp-friends-loader.php

示例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();
 }
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:24,代碼來源:bp-activity-loader.php

示例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();
	}
開發者ID:pombredanne,項目名稱:ArcherSys,代碼行數:27,代碼來源:bp-blogs-loader.php

示例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();
 }
開發者ID:danielcoats,項目名稱:schoolpress,代碼行數:19,代碼來源:loader.php

示例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();
 }
開發者ID:hornetalcala,項目名稱:trunk,代碼行數:23,代碼來源:bp-blogs-loader.php

示例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();
 }
開發者ID:hornetalcala,項目名稱:trunk,代碼行數:30,代碼來源:bp-groups-loader.php

示例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();
 }
開發者ID:newington,項目名稱:buddypress,代碼行數:19,代碼來源:bp-friends-loader.php


注:本文中的BP_Component::setup_title方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。