Changeset 4847 for trunk/bp-activity/bp-activity-actions.php
- Timestamp:
- 07/25/2011 12:29:19 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-actions.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-actions.php
r4819 r4847 23 23 24 24 // No activity to display 25 if ( empty( $bp->action_variables[0] ) || !is_numeric( $bp->action_variables[0]) )25 if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) ) 26 26 return false; 27 27 28 28 // Get the activity details 29 $activity = bp_activity_get_specific( array( 'activity_ids' => $bp->action_variables[0], 'show_hidden' => true ) );29 $activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) ); 30 30 31 31 // 404 if activity does not exist … … 88 88 return false; 89 89 90 if ( empty( $activity_id ) && !empty( $bp->action_variables[0] ) && is_numeric( $bp->action_variables[0]) )91 $activity_id = (int) $bp->action_variables[0];90 if ( empty( $activity_id ) && bp_action_variable( 0 ) ) 91 $activity_id = (int) bp_action_variable( 0 ); 92 92 93 93 // Not viewing a specific activity item … … 212 212 check_admin_referer( 'mark_favorite' ); 213 213 214 if ( bp_activity_add_user_favorite( $bp->action_variables[0]) )214 if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) ) 215 215 bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) ); 216 216 else 217 217 bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' ); 218 218 219 bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0]);219 bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) ); 220 220 } 221 221 add_action( 'bp_actions', 'bp_activity_action_mark_favorite' ); … … 230 230 check_admin_referer( 'unmark_favorite' ); 231 231 232 if ( bp_activity_remove_user_favorite( $bp->action_variables[0]) )232 if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) ) 233 233 bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) ); 234 234 else 235 235 bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' ); 236 236 237 bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0]);237 bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) ); 238 238 } 239 239 add_action( 'bp_actions', 'bp_activity_action_remove_favorite' ); … … 270 270 global $bp, $wp_query; 271 271 272 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')272 if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 273 273 return false; 274 274 … … 284 284 global $bp, $wp_query; 285 285 286 if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')286 if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) ) 287 287 return false; 288 288 … … 298 298 global $bp, $wp_query; 299 299 300 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')300 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) ) 301 301 return false; 302 302 … … 312 312 global $bp, $wp_query; 313 313 314 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || ! isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed')314 if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) ) 315 315 return false; 316 316
Note: See TracChangeset
for help on using the changeset viewer.