Skip to:
Content

BuddyPress.org

Changeset 7751


Ignore:
Timestamp:
01/21/2014 10:39:09 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Replace $bp global references in slug functions with buddypress() calls. See #5138. (trunk)

Location:
trunk
Files:
4 edited

Legend:

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

    r7574 r7751  
    2626     * @since BuddyPress (1.5)
    2727     *
    28      * @global object $bp BuddyPress global settings.
    2928     * @uses apply_filters() To call the 'bp_get_activity_slug' hook.
    3029     *
     
    3231     */
    3332    function bp_get_activity_slug() {
    34         global $bp;
    35         return apply_filters( 'bp_get_activity_slug', $bp->activity->slug );
     33        return apply_filters( 'bp_get_activity_slug', buddypress()->activity->slug );
    3634    }
    3735
     
    5149     * @since BuddyPress (1.5)
    5250     *
    53      * @global object $bp BuddyPress global settings.
    5451     * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook.
    5552     *
     
    5754     */
    5855    function bp_get_activity_root_slug() {
    59         global $bp;
    60         return apply_filters( 'bp_get_activity_root_slug', $bp->activity->root_slug );
     56        return apply_filters( 'bp_get_activity_root_slug', buddypress()->activity->root_slug );
    6157    }
    6258
  • trunk/bp-friends/bp-friends-template.php

    r7560 r7751  
    2727     */
    2828    function bp_get_friends_slug() {
    29         global $bp;
    30         return apply_filters( 'bp_get_friends_slug', $bp->friends->slug );
     29        return apply_filters( 'bp_get_friends_slug', buddypress()->friends->slug );
    3130    }
    3231
     
    4746     */
    4847    function bp_get_friends_root_slug() {
    49         global $bp;
    50         return apply_filters( 'bp_get_friends_root_slug', $bp->friends->root_slug );
     48        return apply_filters( 'bp_get_friends_root_slug', buddypress()->friends->root_slug );
    5149    }
    5250
  • trunk/bp-groups/bp-groups-template.php

    r7745 r7751  
    3131     */
    3232    function bp_get_groups_slug() {
    33         global $bp;
    34         return apply_filters( 'bp_get_groups_slug', $bp->groups->slug );
     33        return apply_filters( 'bp_get_groups_slug', buddypress()->groups->slug );
    3534    }
    3635
     
    5554     */
    5655    function bp_get_groups_root_slug() {
    57         global $bp;
    58         return apply_filters( 'bp_get_groups_root_slug', $bp->groups->root_slug );
     56        return apply_filters( 'bp_get_groups_root_slug', buddypress()->groups->root_slug );
    5957    }
    6058
  • trunk/bp-members/bp-members-template.php

    r7513 r7751  
    3333     */
    3434    function bp_get_members_slug() {
    35         global $bp;
    36         return apply_filters( 'bp_get_members_slug', $bp->members->slug );
     35        return apply_filters( 'bp_get_members_slug', buddypress()->members->slug );
    3736    }
    3837
     
    5756     */
    5857    function bp_get_members_root_slug() {
    59         global $bp;
    60         return apply_filters( 'bp_get_members_root_slug', $bp->members->root_slug );
     58        return apply_filters( 'bp_get_members_root_slug', buddypress()->members->root_slug );
    6159    }
    6260
     
    110108        $bp = buddypress();
    111109
    112         if ( !empty( $bp->pages->register->slug ) )
     110        if ( !empty( $bp->pages->register->slug ) ) {
    113111            $slug = $bp->pages->register->slug;
    114         elseif ( defined( 'BP_REGISTER_SLUG' ) )
     112        } elseif ( defined( 'BP_REGISTER_SLUG' ) ) {
    115113            $slug = BP_REGISTER_SLUG;
    116         else
     114        } else {
    117115            $slug = 'register';
     116        }
    118117
    119118        return apply_filters( 'bp_get_signup_slug', $slug );
     
    140139     */
    141140    function bp_get_activate_slug() {
    142         global $bp;
    143 
    144         if ( !empty( $bp->pages->activate->slug ) )
     141        $bp = buddypress();
     142
     143        if ( !empty( $bp->pages->activate->slug ) ) {
    145144            $slug = $bp->pages->activate->slug;
    146         elseif ( defined( 'BP_ACTIVATION_SLUG' ) )
     145        } elseif ( defined( 'BP_ACTIVATION_SLUG' ) ) {
    147146            $slug = BP_ACTIVATION_SLUG;
    148         else
     147        } else {
    149148            $slug = 'activate';
     149        }
    150150
    151151        return apply_filters( 'bp_get_activate_slug', $slug );
Note: See TracChangeset for help on using the changeset viewer.