Changeset 6981
- Timestamp:
- 05/01/2013 01:48:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-actions.php
r6980 r6981 46 46 */ 47 47 function bp_activity_action_permalink_router() { 48 global $bp;49 48 50 49 // Not viewing activity 51 if ( ! bp_is_activity_component() || !bp_is_current_action( 'p' ) )50 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) ) 52 51 return false; 53 52 54 53 // No activity to display 55 if ( ! bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) )54 if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) ) 56 55 return false; 57 56 … … 63 62 bp_do_404(); 64 63 return; 65 66 64 } else { 67 65 $activity = $activity['activities'][0]; … … 72 70 73 71 // Redirect based on the type of activity 74 if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {72 if ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) { 75 73 76 74 // Activity is a user update 77 if ( ! empty( $activity->user_id ) ) {75 if ( ! empty( $activity->user_id ) ) { 78 76 $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/'; 79 77 … … 93 91 94 92 // If set, add the original query string back onto the redirect URL 95 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {93 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 96 94 $query_frags = array(); 97 95 wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags ); … … 100 98 101 99 // Allow redirect to be filtered 102 if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) )100 if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) { 103 101 bp_core_redirect( bp_get_root_domain() ); 102 } 104 103 105 104 // Redirect to the actual activity permalink page
Note: See TracChangeset
for help on using the changeset viewer.