Skip to:
Content

BuddyPress.org

Changeset 4647


Ignore:
Timestamp:
07/12/2011 02:11:01 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Audit the usage of $bp->friends->slug. See #3325.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-actions.php

    r4646 r4647  
    268268    global $bp, $wp_query;
    269269
    270     if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( $bp->friends->slug ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     270    if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    271271        return false;
    272272
  • trunk/bp-activity/bp-activity-loader.php

    r4621 r4647  
    152152            $sub_nav[] = array(
    153153                'name'            => __( 'Friends', 'buddypress' ),
    154                 'slug'            => $bp->friends->slug,
     154                'slug'            => bp_get_friends_slug(),
    155155                'parent_url'      => $activity_link,
    156156                'parent_slug'     => $this->slug,
  • trunk/bp-friends/bp-friends-actions.php

    r3917 r4647  
    1010    global $bp;
    1111
    12     if ( $bp->current_component != $bp->friends->slug || $bp->current_action != 'add-friend' )
     12    if ( !bp_is_friends_component() || !bp_is_current_action( 'add-friend' ) )
    1313        return false;
    1414
     
    4949    global $bp;
    5050
    51     if ( $bp->current_component != $bp->friends->slug || $bp->current_action != 'remove-friend' )
     51    if ( !bp_is_friends_component() || !bp_is_current_action( 'remove-friend' ) )
    5252        return false;
    5353
  • trunk/bp-friends/bp-friends-activity.php

    r4639 r4647  
    8282
    8383        case 'friendship_request':
    84             $link = bp_loggedin_user_domain() . $bp->friends->slug . '/requests?new';
     84            $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests?new';
    8585           
    8686            // Set up the string and the filter
  • trunk/bp-friends/bp-friends-loader.php

    r4586 r4647  
    103103        );
    104104
    105         $friends_link = trailingslashit( $bp->loggedin_user->domain . $bp->friends->slug );
     105        $friends_link = trailingslashit( $bp->loggedin_user->domain . bp_get_friends_slug() );
    106106
    107107        // Add the subnav items to the friends nav item
    108108        $sub_nav[] = array(
    109             'name' => __( 'Friendships', 'buddypress' ),
    110             'slug' => 'my-friends',
    111             'parent_url' => $friends_link,
    112             'parent_slug' => $bp->friends->slug,
     109            'name'            => __( 'Friendships', 'buddypress' ),
     110            'slug'            => 'my-friends',
     111            'parent_url'      => $friends_link,
     112            'parent_slug'     => bp_get_friends_slug(),
    113113            'screen_function' => 'friends_screen_my_friends',
    114             'position' => 10,
     114            'position'        => 10,
    115115            'item_css_id'     => 'friends-my-friends'
    116116        );
     
    120120            'slug'            => 'requests',
    121121            'parent_url'      => $friends_link,
    122             'parent_slug'     => $bp->friends->slug,
     122            'parent_slug'     => bp_get_friends_slug(),
    123123            'screen_function' => 'friends_screen_requests',
    124124            'position'        => 20,
  • trunk/bp-friends/bp-friends-template.php

    r4612 r4647  
    5252    global $bp; ?>
    5353
    54     <li<?php if ( !isset($bp->action_variables[0]) || 'recently-active' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    55     <li<?php if ( 'newest' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
    56     <li<?php if ( 'alphabetically' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>/my-friends/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     54    <li<?php if ( !isset($bp->action_variables[0]) || 'recently-active' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     55    <li<?php if ( 'newest' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/newest"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
     56    <li<?php if ( 'alphabetically' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>/my-friends/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    5757
    5858<?php
     
    8787
    8888    <div class="info-group">
    89         <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id ) ?>) <span><a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>"><?php _e('See All', 'buddypress') ?> &rarr;</a></span></h4>
     89        <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id ) ?>) <span><a href="<?php echo $bp->displayed_user->domain . bp_get_friends_slug() ?>"><?php _e('See All', 'buddypress') ?> &rarr;</a></span></h4>
    9090
    9191        <?php if ( $friend_ids ) { ?>
     
    186186    global $friends_template, $bp;
    187187
    188     $action = $bp->displayed_user->domain . $bp->friends->slug . '/my-friends/search/';
     188    $action = $bp->displayed_user->domain . bp_get_friends_slug() . '/my-friends/search/';
    189189    $label = __( 'Filter Friends', 'buddypress' ); ?>
    190190
     
    308308                    'wrapper_class'     => 'friendship-button pending',
    309309                    'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    310                     'link_href'         => trailingslashit( $bp->loggedin_user->domain . $bp->friends->slug . '/requests' ),
     310                    'link_href'         => trailingslashit( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests' ),
    311311                    'link_text'         => __( 'Friendship Requested', 'buddypress' ),
    312312                    'link_title'        => __( 'Friendship Requested', 'buddypress' ),
     
    323323                    'wrapper_class'     => 'friendship-button is_friend',
    324324                    'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    325                     'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ),
     325                    'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ),
    326326                    'link_text'         => __( 'Cancel Friendship', 'buddypress' ),
    327327                    'link_title'        => __( 'Cancel Friendship', 'buddypress' ),
     
    340340                    'wrapper_class'     => 'friendship-button not_friends',
    341341                    'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
    342                     'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),
     342                    'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),
    343343                    'link_text'         => __( 'Add Friend', 'buddypress' ),
    344344                    'link_title'        => __( 'Add Friend', 'buddypress' ),
     
    398398        }
    399399
    400         return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) );
     400        return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ) );
    401401    }
    402402
     
    412412        }
    413413
    414         return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) );
     414        return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ) );
    415415    }
    416416
  • trunk/bp-members/bp-members-buddybar.php

    r4605 r4647  
    181181
    182182                <li>
    183                     <a href="<?php echo trailingslashit( $bp->displayed_user->domain . $bp->friends->slug ); ?>"><?php _e( 'Friends', 'buddypress' ); ?></a>
     183                    <a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_friends_slug() ); ?>"><?php _e( 'Friends', 'buddypress' ); ?></a>
    184184                    <ul>
    185185                        <li><a href="<?php bp_members_component_link( 'friends', 'admin', array( 'clear' => 'friendships' ), true ); ?>" class="confirm"><?php printf( __( "Remove %s's Friendships", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li>
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r4646 r4647  
    413413            echo __("Friendship could not be canceled.", 'buddypress');
    414414        } else {
    415             echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
     415            echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( $bp->loggedin_user->domain . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>';
    416416        }
    417417
     
    423423            echo __("Friendship could not be requested.", 'buddypress');
    424424        } else {
    425             echo '<a href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/requests" class="requested">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
     425            echo '<a href="' . $bp->loggedin_user->domain . bp_get_friends_slug() . '/requests" class="requested">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
    426426        }
    427427    } else {
Note: See TracChangeset for help on using the changeset viewer.