Skip to:
Content

BuddyPress.org

Changeset 6047


Ignore:
Timestamp:
05/27/2012 02:37:27 PM (13 years ago)
Author:
boonebgorges
Message:

Cleanup of outdated URL parameters in Friends component.

Before BuddyPress 1.2, it was possible to set the order of a friends list
(alphabetical, newest, recently active) by appending the appropriate action
variable. This changeset cleans up some remaining remnants of this outdated
method of filtering:

  • Deprecates functions responsible for rendering related Alphabetical, Newest,

and Recently Active links

  • Cleans up Friends notification functions so that the deprecated URLs are not

applied to Friendship Accepted notifications

Fixes #4077

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/deprecated/1.6.php

    r6039 r6047  
    9393    _deprecated_function( __FUNCTION__, '1.6' );
    9494}
     95
     96/**
     97 * Friends functions
     98 */
     99
     100/**
     101 * Displays Friends header tabs
     102 *
     103 * @deprecated 1.6
     104 * @deprecated No longer used
     105 */
     106function bp_friends_header_tabs() {
     107    _deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' );
     108?>
     109
     110    <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     111    <li<?php if ( bp_is_action_variable( 'newest', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/newest' ) ?>"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
     112    <li<?php if ( bp_is_action_variable( 'alphabetically', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     113
     114<?php
     115    do_action( 'friends_header_tabs' );
     116}
     117
     118/**
     119 * Filters the title for the Friends component
     120 *
     121 * @deprecated 1.6
     122 * @deprecated No longer used
     123 */
     124function bp_friends_filter_title() {
     125    _deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' );
     126
     127    $current_filter = bp_action_variable( 0 );
     128
     129    switch ( $current_filter ) {
     130        case 'recently-active': default:
     131            _e( 'Recently Active', 'buddypress' );
     132            break;
     133        case 'newest':
     134            _e( 'Newest', 'buddypress' );
     135            break;
     136        case 'alphabetically':
     137            _e( 'Alphabetically', 'buddypress' );
     138            break;
     139    }
     140}
     141
    95142
    96143/**
  • trunk/bp-friends/bp-friends-activity.php

    r5868 r6047  
    8080    switch ( $action ) {
    8181        case 'friendship_accepted':
    82             $link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/newest' );
     82            $link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends' );
    8383
    8484            // Set up the string and the filter
  • trunk/bp-friends/bp-friends-template.php

    r5931 r6047  
    5858        return apply_filters( 'bp_get_friends_root_slug', $bp->friends->root_slug );
    5959    }
    60 
    61 /**
    62  * Displays Friends header tabs
    63  *
    64  * @package BuddyPress
    65  * @todo Deprecate?
    66  */
    67 function bp_friends_header_tabs() {
    68 ?>
    69 
    70     <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    71     <li<?php if ( bp_is_action_variable( 'newest', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/newest' ) ?>"><?php _e( 'Newest', 'buddypress' ) ?></a></li>
    72     <li<?php if ( bp_is_action_variable( 'alphabetically', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    73 
    74 <?php
    75     do_action( 'friends_header_tabs' );
    76 }
    77 
    78 /**
    79  * Filters the title for the Friends component
    80  *
    81  * @package BuddyPress
    82  * @todo Deprecate?
    83  */
    84 function bp_friends_filter_title() {
    85     $current_filter = bp_action_variable( 0 );
    86 
    87     switch ( $current_filter ) {
    88         case 'recently-active': default:
    89             _e( 'Recently Active', 'buddypress' );
    90             break;
    91         case 'newest':
    92             _e( 'Newest', 'buddypress' );
    93             break;
    94         case 'alphabetically':
    95             _e( 'Alphabetically', 'buddypress' );
    96             break;
    97     }
    98 }
    9960
    10061function bp_friends_random_friends() {
Note: See TracChangeset for help on using the changeset viewer.