Changeset 10323 for trunk/src/bp-friends/bp-friends-loader.php
- Timestamp:
- 11/02/2015 02:07:44 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-loader.php
r10147 r10323 12 12 defined( 'ABSPATH' ) || exit; 13 13 14 /** 15 * Defines the BuddyPress Friends Component. 16 */ 14 17 class BP_Friends_Component extends BP_Component { 15 18 … … 75 78 } 76 79 77 // Define a slug, if necessary 80 // Define a slug, if necessary. 78 81 if ( ! defined( 'BP_FRIENDS_SLUG' ) ) { 79 82 define( 'BP_FRIENDS_SLUG', $this->id ); 80 83 } 81 84 82 // Global tables for the friends component 85 // Global tables for the friends component. 83 86 $global_tables = array( 84 87 'table_name' => $bp->table_prefix . 'bp_friends', … … 113 116 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 114 117 115 // Determine user to use 118 // Determine user to use. 116 119 if ( bp_displayed_user_domain() ) { 117 120 $user_domain = bp_displayed_user_domain(); … … 126 129 $friends_link = trailingslashit( $user_domain . $slug ); 127 130 128 // Add 'Friends' to the main navigation 131 // Add 'Friends' to the main navigation. 129 132 $count = friends_get_total_friend_count(); 130 133 $class = ( 0 === $count ) ? 'no-count' : 'count'; … … 138 141 ); 139 142 140 // Add the subnav items to the friends nav item 143 // Add the subnav items to the friends nav item. 141 144 $sub_nav[] = array( 142 145 'name' => _x( 'Friendships', 'Friends screen sub nav', 'buddypress' ), … … 174 177 public function setup_admin_bar( $wp_admin_nav = array() ) { 175 178 176 // Menus for logged in user 179 // Menus for logged in user. 177 180 if ( is_user_logged_in() ) { 178 181 179 // Setup the logged in user variables 182 // Setup the logged in user variables. 180 183 $friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() ); 181 184 182 // Pending friend requests 185 // Pending friend requests. 183 186 $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ); 184 187 if ( !empty( $count ) ) { … … 190 193 } 191 194 192 // Add the "My Account" sub menus 195 // Add the "My Account" sub menus. 193 196 $wp_admin_nav[] = array( 194 197 'parent' => buddypress()->my_account_menu_id, … … 198 201 ); 199 202 200 // My Friends 203 // My Friends. 201 204 $wp_admin_nav[] = array( 202 205 'parent' => 'my-account-' . $this->id, … … 206 209 ); 207 210 208 // Requests 211 // Requests. 209 212 $wp_admin_nav[] = array( 210 213 'parent' => 'my-account-' . $this->id, … … 223 226 public function setup_title() { 224 227 225 // Adjust title 228 // Adjust title. 226 229 if ( bp_is_friends_component() ) { 227 230 $bp = buddypress(); … … 249 252 public function setup_cache_groups() { 250 253 251 // Global groups 254 // Global groups. 252 255 wp_cache_add_global_groups( array( 253 256 'bp_friends_requests'
Note: See TracChangeset
for help on using the changeset viewer.