Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/02/2015 02:07:44 AM (11 years ago)
Author:
tw2113
Message:

More docs cleanup for Friends component.

See #6400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-loader.php

    r10147 r10323  
    1212defined( 'ABSPATH' ) || exit;
    1313
     14/**
     15 * Defines the BuddyPress Friends Component.
     16 */
    1417class BP_Friends_Component extends BP_Component {
    1518
     
    7578                }
    7679
    77                 // Define a slug, if necessary
     80                // Define a slug, if necessary.
    7881                if ( ! defined( 'BP_FRIENDS_SLUG' ) ) {
    7982                        define( 'BP_FRIENDS_SLUG', $this->id );
    8083                }
    8184
    82                 // Global tables for the friends component
     85                // Global tables for the friends component.
    8386                $global_tables = array(
    8487                        'table_name'      => $bp->table_prefix . 'bp_friends',
     
    113116        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    114117
    115                 // Determine user to use
     118                // Determine user to use.
    116119                if ( bp_displayed_user_domain() ) {
    117120                        $user_domain = bp_displayed_user_domain();
     
    126129                $friends_link = trailingslashit( $user_domain . $slug );
    127130
    128                 // Add 'Friends' to the main navigation
     131                // Add 'Friends' to the main navigation.
    129132                $count    = friends_get_total_friend_count();
    130133                $class    = ( 0 === $count ) ? 'no-count' : 'count';
     
    138141                );
    139142
    140                 // Add the subnav items to the friends nav item
     143                // Add the subnav items to the friends nav item.
    141144                $sub_nav[] = array(
    142145                        'name'            => _x( 'Friendships', 'Friends screen sub nav', 'buddypress' ),
     
    174177        public function setup_admin_bar( $wp_admin_nav = array() ) {
    175178
    176                 // Menus for logged in user
     179                // Menus for logged in user.
    177180                if ( is_user_logged_in() ) {
    178181
    179                         // Setup the logged in user variables
     182                        // Setup the logged in user variables.
    180183                        $friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() );
    181184
    182                         // Pending friend requests
     185                        // Pending friend requests.
    183186                        $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) );
    184187                        if ( !empty( $count ) ) {
     
    190193                        }
    191194
    192                         // Add the "My Account" sub menus
     195                        // Add the "My Account" sub menus.
    193196                        $wp_admin_nav[] = array(
    194197                                'parent' => buddypress()->my_account_menu_id,
     
    198201                        );
    199202
    200                         // My Friends
     203                        // My Friends.
    201204                        $wp_admin_nav[] = array(
    202205                                'parent' => 'my-account-' . $this->id,
     
    206209                        );
    207210
    208                         // Requests
     211                        // Requests.
    209212                        $wp_admin_nav[] = array(
    210213                                'parent' => 'my-account-' . $this->id,
     
    223226        public function setup_title() {
    224227
    225                 // Adjust title
     228                // Adjust title.
    226229                if ( bp_is_friends_component() ) {
    227230                        $bp = buddypress();
     
    249252        public function setup_cache_groups() {
    250253
    251                 // Global groups
     254                // Global groups.
    252255                wp_cache_add_global_groups( array(
    253256                        'bp_friends_requests'
Note: See TracChangeset for help on using the changeset viewer.