Changeset 4558 for trunk/bp-activity/bp-activity-functions.php
- Timestamp:
- 06/24/2011 06:52:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-functions.php
r4553 r4558 39 39 */ 40 40 function bp_activity_clear_new_mentions( $user_id ) { 41 delete_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ));42 delete_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ));41 bp_delete_user_meta( $user_id, 'bp_new_mention_count' ); 42 bp_delete_user_meta( $user_id, 'bp_new_mentions' ); 43 43 } 44 44 … … 65 65 66 66 // Adjust the mention list and count for the member 67 $new_mention_count = (int) get_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ), true );68 if ( !$new_mentions = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ), true ) )67 $new_mention_count = (int)bp_get_user_meta( $user_id, 'bp_new_mention_count', true ); 68 if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) ) 69 69 $new_mentions = array(); 70 70 … … 89 89 90 90 // Resave the user_meta 91 update_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mention_count' ), $new_mention_count );92 update_user_meta( $user_id, bp_get_user_meta_key( 'bp_new_mentions' ), $new_mentions );91 bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count ); 92 bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions ); 93 93 } 94 94 } … … 191 191 192 192 // Get favorites for user 193 $favs = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_favorite_activities' ), true );193 $favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ); 194 194 195 195 return apply_filters( 'bp_activity_get_user_favorites', $favs ); … … 216 216 217 217 // Update the user's personal favorites 218 $my_favs = get_user_meta( $bp->loggedin_user->id, bp_get_user_meta_key( 'bp_favorite_activities' ), true );218 $my_favs = bp_get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true ); 219 219 $my_favs[] = $activity_id; 220 220 … … 224 224 225 225 // Update user meta 226 update_user_meta( $bp->loggedin_user->id, bp_get_user_meta_key( 'bp_favorite_activities' ), $my_favs );226 bp_update_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs ); 227 227 228 228 // Update activity meta counts … … 256 256 257 257 // Remove the fav from the user's favs 258 $my_favs = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_favorite_activities' ), true );258 $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ); 259 259 $my_favs = array_flip( (array) $my_favs ); 260 260 unset( $my_favs[$activity_id] ); … … 268 268 269 269 // Update users favorites 270 if ( update_user_meta( $user_id, bp_get_user_meta_key( 'bp_favorite_activities' ), $my_favs ) ) {270 if ( bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ) ) { 271 271 272 272 // Execute additional code … … 500 500 501 501 // Remove any usermeta 502 delete_user_meta( $user_id, bp_get_user_meta_key( 'bp_latest_update' ));503 delete_user_meta( $user_id, bp_get_user_meta_key( 'bp_favorite_activities' ));502 bp_delete_user_meta( $user_id, 'bp_latest_update' ); 503 bp_delete_user_meta( $user_id, 'bp_favorite_activities' ); 504 504 505 505 // Execute additional code … … 676 676 677 677 // Add this update to the "latest update" usermeta so it can be fetched anywhere. 678 update_user_meta( $bp->loggedin_user->id, bp_get_user_meta_key( 'bp_latest_update' ), array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );678 bp_update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) ); 679 679 680 680 // Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. … … 808 808 do_action( 'bp_before_activity_delete', $args ); 809 809 810 $latest_update = get_user_meta( $user_id, bp_get_user_meta_key( 'bp_latest_update' ), true );810 $latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true ); 811 811 if ( !empty( $latest_update ) ) { 812 812 if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) ) 813 delete_user_meta( $user_id, bp_get_user_meta_key( 'bp_latest_update' ));813 bp_delete_user_meta( $user_id, 'bp_latest_update' ); 814 814 } 815 815
Note: See TracChangeset
for help on using the changeset viewer.