Skip to:
Content

BuddyPress.org

Ticket #2294: 2294.001.diff

File 2294.001.diff, 44.1 KB (added by cnorris23, 15 years ago)

first pass

  • bp-friends.php

     
    112112                <tr>
    113113                        <td></td>
    114114                        <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
    115                         <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_request') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_request') ) { ?>checked="checked" <?php } ?>/></td>
    116                         <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_usermeta( $current_user->id,'notification_friends_friendship_request') == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     115                        <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     116                        <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
    117117                </tr>
    118118                <tr>
    119119                        <td></td>
    120120                        <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
    121                         <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_usermeta( $current_user->id,'notification_friends_friendship_accepted') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>
    122                         <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>
     121                        <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
     122                        <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
    123123                </tr>
    124124
    125125                <?php do_action( 'friends_screen_notification_settings' ); ?>
     
    443443                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
    444444
    445445        if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) {
    446                 $count = get_usermeta( $user_id, 'total_friend_count' );
     446                $count = get_user_meta( $user_id, 'total_friend_count', true );
    447447                if ( empty( $count ) ) $count = 0;
    448448                wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' );
    449449        }
     
    546546
    547547function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
    548548        if ( 'add' == $status ) {
    549                 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 );
    550                 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) + 1 );
     549                update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 );
     550                update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) + 1 );
    551551        } else {
    552                 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) - 1 );
    553                 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) - 1 );
     552                update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) - 1 );
     553                update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) - 1 );
    554554        }
    555555}
    556556
     
    558558        BP_Friends_Friendship::delete_all_for_user($user_id);
    559559
    560560        /* Remove usermeta */
    561         delete_usermeta( $user_id, 'total_friend_count' );
     561        delete_user_meta( $user_id, 'total_friend_count' );
    562562
    563563        /* Remove friendship requests FROM user */
    564564        bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' );
  • bp-activity.php

     
    193193                <tr>
    194194                        <td></td>
    195195                        <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ) ) ?></td>
    196                         <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>
    197                         <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>
     196                        <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
     197                        <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
    198198                </tr>
    199199                <tr>
    200200                        <td></td>
    201201                        <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login ) ?></td>
    202                         <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>
    203                         <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>
     202                        <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
     203                        <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
    204204                </tr>
    205205
    206206                <?php do_action( 'bp_activity_screen_notification_settings' ) ?>
     
    627627        ) );
    628628
    629629        /* Add this update to the "latest update" usermeta so it can be fetched anywhere. */
    630         update_usermeta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
     630        update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
    631631
    632632        /* Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. */
    633633        require_once( BP_PLUGIN_DIR . '/bp-activity/bp-activity-notifications.php' );
     
    754754        else
    755755                $user_id = $args['user_id'];
    756756
    757         $latest_update = get_usermeta( $user_id, 'bp_latest_update' );
     757        $latest_update = get_user_meta( $user_id, 'bp_latest_update', true );
    758758        if ( !empty( $latest_update ) ) {
    759759                if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) )
    760                         delete_usermeta( $user_id, 'bp_latest_update' );
     760                        delete_user_meta( $user_id, 'bp_latest_update' );
    761761        }
    762762
    763763        do_action( 'bp_activity_delete', $args );
     
    908908}
    909909
    910910function bp_activity_get_user_favorites( $user_id ) {
    911         $my_favs = maybe_unserialize( get_usermeta( $user_id, 'bp_favorite_activities' ) );
     911        $my_favs = get_user_meta( $user_id, 'bp_favorite_activities', true );
    912912        $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $my_favs ) );
    913913
    914914        foreach( (array)$existing_favs['activities'] as $fav )
    915915                $new_favs[] = $fav->id;
    916916
    917917        $new_favs = array_unique( (array)$new_favs );
    918         update_usermeta( $user_id, 'bp_favorite_activities', $new_favs );
     918        update_user_meta( $user_id, 'bp_favorite_activities', $new_favs );
    919919
    920920        return apply_filters( 'bp_activity_get_user_favorites', $new_favs );
    921921}
     
    927927                $user_id = $bp->loggedin_user->id;
    928928
    929929        /* Update the user's personal favorites */
    930         $my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
     930        $my_favs = get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true );
    931931        $my_favs[] = $activity_id;
    932932
    933933        /* Update the total number of users who have favorited this activity */
     
    938938        else
    939939                $fav_count = 1;
    940940
    941         update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
     941        update_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
    942942        bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
    943943
    944944        do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
     
    953953                $user_id = $bp->loggedin_user->id;
    954954
    955955        /* Remove the fav from the user's favs */
    956         $my_favs = maybe_unserialize( get_usermeta( $user_id, 'bp_favorite_activities' ) );
     956        $my_favs = get_user_meta( $user_id, 'bp_favorite_activities', true );
    957957        $my_favs = array_flip( (array) $my_favs );
    958958        unset( $my_favs[$activity_id] );
    959959        $my_favs = array_unique( array_flip( $my_favs ) );
     
    966966                bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
    967967        }
    968968
    969         update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
     969        update_user_meta( $user_id, 'bp_favorite_activities', $my_favs );
    970970
    971971        do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
    972972
     
    10881088        bp_activity_delete( array( 'user_id' => $user_id ) );
    10891089
    10901090        // Remove any usermeta
    1091         delete_usermeta( $user_id, 'bp_latest_update' );
    1092         delete_usermeta( $user_id, 'bp_favorite_activities' );
     1091        delete_user_meta( $user_id, 'bp_latest_update' );
     1092        delete_user_meta( $user_id, 'bp_favorite_activities' );
    10931093
    10941094        do_action( 'bp_activity_remove_data', $user_id );
    10951095}
  • bp-themes/bp-default/_inc/ajax.php

     
    9292                        break;
    9393                case 'mentions':
    9494                        $feed_url = $bp->loggedin_user->domain . BP_ACTIVITY_SLUG . '/mentions/feed/';
    95                         delete_usermeta( $bp->loggedin_user->id, 'bp_new_mention_count' );
     95                        delete_user_meta( $bp->loggedin_user->id, 'bp_new_mention_count' );
    9696                        break;
    9797        }
    9898
     
    442442        if ( !isset( $_POST['notice_id'] ) ) {
    443443                echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'buddypress') . '</p></div>';
    444444        } else {
    445                 $notice_ids = get_usermeta( $userdata->ID, 'closed_notices' );
     445                $notice_ids = get_user_meta( $userdata->ID, 'closed_notices', true );
    446446
    447447                $notice_ids[] = (int) $_POST['notice_id'];
    448448
    449                 update_usermeta( $userdata->ID, 'closed_notices', $notice_ids );
     449                update_user_meta( $userdata->ID, 'closed_notices', $notice_ids );
    450450        }
    451451}
    452452add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
  • bp-xprofile/bp-xprofile-templatetags.php

     
    637637        function bp_get_profile_last_updated() {
    638638                global $bp;
    639639
    640                 $last_updated = get_usermeta( $bp->displayed_user->id, 'profile_last_updated' );
     640                $last_updated = get_user_meta( $bp->displayed_user->id, 'profile_last_updated', true );
    641641
    642642                if ( $last_updated )
    643643                        return apply_filters( 'bp_get_profile_last_updated', sprintf( __('Profile updated %s ago', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) );
  • bp-core/bp-core-signup.php

     
    360360         */
    361361        if ( !bp_core_is_multisite() ) {
    362362                $activation_key = wp_hash( $user_id );
    363                 update_usermeta( $user_id, 'activation_key', $activation_key );
     363                update_user_meta( $user_id, 'activation_key', $activation_key );
    364364                bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
    365365        }
    366366
     
    422422                wp_new_user_notification( $user_id );
    423423
    424424                /* Remove the activation key meta */
    425                 delete_usermeta( $user_id, 'activation_key' );
     425                delete_user_meta( $user_id, 'activation_key' );
    426426        }
    427427
    428428        /* Update the user_url and display_name */
    429429        wp_update_user( array( 'ID' => $user_id, 'user_url' => bp_core_get_user_domain( $user_id, sanitize_title( $user_login ), $user_login ), 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
    430430
    431431        /* Add a last active entry */
    432         update_usermeta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
     432        update_user_meta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    433433
    434434        /* Set the password on multisite installs */
    435435        if ( bp_core_is_multisite() && !empty( $user['meta']['password'] ) )
     
    472472                return false;
    473473
    474474        /* Add a last active entry */
    475         update_usermeta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
     475        update_user_meta( $user_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    476476
    477477        /* Add the user's fullname to Xprofile */
    478478        if ( function_exists( 'xprofile_set_field_data' ) ) {
    479                 $firstname = get_usermeta( $user_id, 'first_name' );
    480                 $lastname = ' ' . get_usermeta( $user_id, 'last_name' );
     479                $firstname = get_user_meta( $user_id, 'first_name', true );
     480                $lastname = ' ' . get_user_meta( $user_id, 'last_name', true );
    481481                $name = $firstname . $lastname;
    482482
    483483                if ( empty( $name ) || ' ' == $name )
    484                         $name = get_usermeta( $user_id, 'nickname' );
     484                        $name = get_user_meta( $user_id, 'nickname', true );
    485485
    486486                xprofile_set_field_data( 1, $user_id, $name );
    487487        }
  • bp-core/bp-core-templatetags.php

     
    677677        if ( !$user_id )
    678678                $user_id = $bp->displayed_user->id;
    679679
    680         $last_activity = bp_core_get_last_activity( get_usermeta( $user_id, 'last_activity' ), __('active %s ago', 'buddypress') );
     680        $last_activity = bp_core_get_last_activity( get_user_meta( $user_id, 'last_activity', true ), __('active %s ago', 'buddypress') );
    681681
    682682        if ( $echo )
    683683                echo apply_filters( 'bp_last_activity', $last_activity );
  • bp-core/bp-core-classes.php

     
    5050         * @uses bp_core_get_userurl() Returns the URL with no HTML markup for a user based on their user id
    5151         * @uses bp_core_get_userlink() Returns a HTML formatted link for a user with the user's full name as the link text
    5252         * @uses bp_core_get_user_email() Returns the email address for the user based on user ID
    53          * @uses get_usermeta() WordPress function returns the value of passed usermeta name from usermeta table
     53         * @uses get_user_meta() WordPress function returns the value of passed usermeta name from usermeta table
    5454         * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user
    5555         * @uses bp_profile_last_updated_date() Returns the last updated date for a user.
    5656         */
     
    7979                $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb' ) );
    8080                $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) );
    8181
    82                 $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );
     82                $this->last_active = bp_core_get_last_activity( get_user_meta( $this->id, 'last_activity', true ), __( 'active %s ago', 'buddypress' ) );
    8383        }
    8484
    8585        function populate_extras() {
  • bp-core/bp-core-settings.php

     
    114114
    115115                if ( $_POST['notifications'] ) {
    116116                        foreach ( (array)$_POST['notifications'] as $key => $value ) {
    117                                 update_usermeta( (int)$current_user->id, $key, $value );
     117                                update_user_meta( (int)$current_user->id, $key, $value );
    118118                        }
    119119                }
    120120
  • bp-friends/bp-friends-notifications.php

     
    55
    66        $initiator_name = bp_core_get_user_displayname( $initiator_id );
    77
    8         if ( 'no' == get_usermeta( (int)$friend_id, 'notification_friends_friendship_request' ) )
     8        if ( 'no' == get_user_meta( (int)$friend_id, 'notification_friends_friendship_request', true ) )
    99                return false;
    1010
    1111        $ud = get_userdata( $friend_id );
     
    4747
    4848        $friend_name = bp_core_get_user_displayname( $friend_id );
    4949
    50         if ( 'no' == get_usermeta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) )
     50        if ( 'no' == get_user_meta( (int)$initiator_id, 'notification_friends_friendship_accepted', true ) )
    5151                return false;
    5252
    5353        $ud = get_userdata( $initiator_id );
  • bp-friends/bp-friends-classes.php

     
    129129                if ( !$count )
    130130                        return 0;
    131131
    132                 update_usermeta( $user_id, 'total_friend_count', $count );
     132                update_user_meta( $user_id, 'total_friend_count', $count );
    133133                return $count;
    134134        }
    135135
  • bp-activity/bp-activity-filters.php

     
    105105                        continue;
    106106
    107107                /* Increase the number of new @ mentions for the user */
    108                 $new_mention_count = (int)get_usermeta( $user_id, 'bp_new_mention_count' );
    109                 update_usermeta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
     108                $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true );
     109                update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
    110110
    111111                $content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
    112112        }
  • bp-activity/bp-activity-notifications.php

     
    1616                        continue;
    1717
    1818                // Now email the user with the contents of the message (if they have enabled email notifications)
    19                 if ( 'no' != get_usermeta( $user_id, 'notification_activity_new_mention' ) ) {
     19                if ( 'no' != get_user_meta( $user_id, 'notification_activity_new_mention', true ) ) {
    2020                        $poster_name = bp_core_get_user_displayname( $poster_user_id );
    2121
    2222                        $message_link = bp_activity_get_permalink( $activity_id );
     
    6060
    6161        $original_activity = new BP_Activity_Activity( $activity_id );
    6262
    63         if ( $original_activity->user_id != $commenter_id && 'no' != get_usermeta( $original_activity->user_id, 'notification_activity_new_reply' ) ) {
     63        if ( $original_activity->user_id != $commenter_id && 'no' != get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) {
    6464                $poster_name = bp_core_get_user_displayname( $commenter_id );
    6565                $thread_link = bp_activity_get_permalink( $activity_id );
    6666                $settings_link = bp_core_get_user_domain( $original_activity->user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
     
    102102
    103103        $parent_comment = new BP_Activity_Activity( $parent_id );
    104104
    105         if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_usermeta( $parent_comment->user_id, 'notification_activity_new_reply' ) ) {
     105        if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) {
    106106                $poster_name = bp_core_get_user_displayname( $commenter_id );
    107107                $thread_link = bp_activity_get_permalink( $activity_id );
    108108                $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) .  BP_SETTINGS_SLUG . '/notifications/';
  • bp-activity/bp-activity-templatetags.php

     
    2525                $this->disable_blogforum_replies = $bp->site_options['bp-disable-blogforum-comments'];
    2626
    2727                /* Get an array of the logged in user's favorite activities */
    28                 $this->my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
     28                $this->my_favs = get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true );
    2929
    3030                if ( !empty( $include ) ) {
    3131                        /* Fetch specific activity items based on ID's */
     
    728728                if ( !$user_id )
    729729                        $user_id = $bp->displayed_user->id;
    730730
    731                 if ( !$update = get_usermeta( $user_id, 'bp_latest_update' ) )
     731                if ( !$update = get_user_meta( $user_id, 'bp_latest_update', true ) )
    732732                        return false;
    733733
    734734                $latest_update = '&quot;' . trim( strip_tags( bp_create_excerpt( $update['content'], 40 ) ) ) . '&quot;';
     
    830830        echo bp_get_total_favorite_count_for_user( $user_id );
    831831}
    832832        function bp_get_total_mention_count_for_user( $user_id = false ) {
    833                 return apply_filters( 'bp_get_total_mention_count_for_user', get_usermeta( $user_id, 'bp_new_mention_count' ) );
     833                return apply_filters( 'bp_get_total_mention_count_for_user', get_user_meta( $user_id, 'bp_new_mention_count', true ) );
    834834        }
    835835
    836836function bp_send_public_message_link() {
  • bp-activity/bp-activity-classes.php

     
    531531        function total_favorite_count( $user_id ) {
    532532                global $bp;
    533533
    534                 if ( !$favorite_activity_entries = get_usermeta( $user_id, 'bp_favorite_activities' ) )
     534                if ( !$favorite_activity_entries = get_user_meta( $user_id, 'bp_favorite_activities', true ) )
    535535                        return 0;
    536536
    537                 return count( maybe_unserialize( $favorite_activity_entries ) );
     537                return count( $favorite_activity_entries );
    538538        }
    539539
    540540        function check_exists_by_content( $content ) {
  • bp-messages.php

     
    175175                <tr>
    176176                        <td></td>
    177177                        <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
    178                         <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_message' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>
    179                         <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>
     178                        <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_message', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
     179                        <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
    180180                </tr>
    181181                <tr>
    182182                        <td></td>
    183183                        <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
    184                         <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_messages_new_notice' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>
    185                         <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>
     184                        <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
     185                        <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
    186186                </tr>
    187187
    188188                <?php do_action( 'messages_screen_notification_settings' ) ?>
  • bp-forums.php

     
    500500function bp_forums_filter_caps( $allcaps ) {
    501501        global $bp, $wp_roles, $bb_table_prefix;
    502502
    503         $bb_cap = get_usermeta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' );
     503        $bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true );
    504504
    505505        if ( empty( $bb_cap ) )
    506506                return $allcaps;
  • bp-groups.php

     
    894894                <tr>
    895895                        <td></td>
    896896                        <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
    897                         <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_invite') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>
    898                         <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>
     897                        <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_invite', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
     898                        <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
    899899                </tr>
    900900                <tr>
    901901                        <td></td>
    902902                        <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
    903                         <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_group_updated') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>
    904                         <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>
     903                        <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
     904                        <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
    905905                </tr>
    906906                <tr>
    907907                        <td></td>
    908908                        <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
    909                         <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_admin_promotion') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>
    910                         <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>
     909                        <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
     910                        <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
    911911                </tr>
    912912                <tr>
    913913                        <td></td>
    914914                        <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
    915                         <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_usermeta( $current_user->id, 'notification_groups_membership_request') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>
    916                         <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_usermeta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>
     915                        <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     916                        <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    917917                </tr>
    918918
    919919                <?php do_action( 'groups_screen_notification_settings' ); ?>
     
    15641564                return false;
    15651565
    15661566        /* Modify group member count */
    1567         groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') - 1 );
     1567        groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count' ) - 1 );
    15681568
    15691569        /* Modify user's group memberhip count */
    1570         update_usermeta( $user_id, 'total_group_count', (int) get_usermeta( $user_id, 'total_group_count') - 1 );
     1570        update_user_meta( $user_id, 'total_group_count', (int) get_user_meta( $user_id, 'total_group_count', true ) - 1 );
    15711571
    15721572        /* If the user joined this group less than five minutes ago, remove the joined_group activity so
    15731573         * users cannot flood the activity stream by joining/leaving the group in quick succession.
     
    21912191        if ( !$member->ban() )
    21922192                return false;
    21932193
    2194         update_usermeta( $user_id, 'total_group_count', (int)$total_count - 1 );
     2194        update_user_meta( $user_id, 'total_group_count', (int)$total_count - 1 );
    21952195}
    21962196
    21972197function groups_unban_member( $user_id, $group_id ) {
  • bp-messages/bp-messages-notifications.php

     
    77        $sender_name = bp_core_get_user_displayname( $sender_id );
    88
    99        foreach( $recipients as $recipient ) {
    10                 if ( $sender_id == $recipient->user_id || 'no' == get_usermeta( $recipient->user_id, 'notification_messages_new_message' ) ) continue;
     10                if ( $sender_id == $recipient->user_id || 'no' == get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) ) continue;
    1111
    1212                $ud = get_userdata( $recipient->user_id );
    1313                $message_link = bp_core_get_user_domain( $recipient->user_id ) . BP_MESSAGES_SLUG .'/';
  • bp-messages/bp-messages-templatetags.php

     
    455455        if ( empty( $notice ) )
    456456                return false;
    457457
    458         $closed_notices = get_usermeta( $userdata->ID, 'closed_notices' );
     458        $closed_notices = get_user_meta( $userdata->ID, 'closed_notices', true );
    459459
    460460        if ( !$closed_notices )
    461461                $closed_notices = array();
  • bp-messages/bp-messages-classes.php

     
    401401                // Now deactivate all notices apart from the new one.
    402402                $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) );
    403403
    404                 update_usermeta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );
     404                update_user_meta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );
    405405
    406406                do_action( 'messages_notice_after_save', $this );
    407407
  • bp-forums/bp-forums-bbpress.php

     
    103103                /* Set the site admins as the keymasters */
    104104                $site_admins = get_site_option( 'site_admins', array('admin') );
    105105                foreach ( (array)$site_admins as $site_admin )
    106                         update_usermeta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
     106                        update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
    107107
    108108                // Create the first forum.
    109109                bb_new_forum( array( 'forum_name' => 'Default Forum' ) );
     
    130130                $args = wp_parse_args( $args, $defaults );
    131131                extract( $args, EXTR_SKIP );
    132132
    133                 return update_usermeta( $id, $meta_key, $meta_value );
     133                return update_user_meta( $id, $meta_key, $meta_value );
    134134        }
    135135}
    136136
  • bp-core.php

     
    513513 * @package BuddyPress Core
    514514 * @global $current_user WordPress global variable containing current logged in user information
    515515 * @param user_id The ID of the user.
    516  * @uses get_usermeta() WordPress function to get the usermeta for a user.
     516 * @uses get_user_meta() WordPress function to get the usermeta for a user.
    517517 */
    518518function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) {
    519519        global $bp;
     
    13841384 *
    13851385 * @package BuddyPress Core
    13861386 * @global $userdata WordPress user data for the current logged in user.
    1387  * @uses update_usermeta() WordPress function to update user metadata in the usermeta table.
     1387 * @uses update_user_meta() WordPress function to update user metadata in the usermeta table.
    13881388 */
    13891389function bp_core_record_activity() {
    13901390        global $bp;
     
    13921392        if ( !is_user_logged_in() )
    13931393                return false;
    13941394
    1395         $activity = get_usermeta( $bp->loggedin_user->id, 'last_activity' );
     1395        $activity = get_user_meta( $bp->loggedin_user->id, 'last_activity', true );
    13961396
    13971397        if ( !is_numeric( $activity ) )
    13981398                $activity = strtotime( $activity );
    13991399
    14001400        if ( '' == $activity || strtotime( gmdate( "Y-m-d H:i:s" ) ) >= strtotime( '+5 minutes', $activity ) )
    1401                 update_usermeta( $bp->loggedin_user->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
     1401                update_user_meta( $bp->loggedin_user->id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
    14021402}
    14031403add_action( 'wp_head', 'bp_core_record_activity' );
    14041404
     
    18251825 *
    18261826 * @package BuddyPress Core
    18271827 * @param $user_id The user id for the user to delete usermeta for
    1828  * @uses delete_usermeta() deletes a row from the wp_usermeta table based on meta_key
     1828 * @uses delete_user_meta() deletes a row from the wp_usermeta table based on meta_key
    18291829 */
    18301830function bp_core_remove_data( $user_id ) {
    18311831        /* Remove usermeta */
    1832         delete_usermeta( $user_id, 'last_activity' );
     1832        delete_user_meta( $user_id, 'last_activity' );
    18331833
    18341834        /* Flush the cache to remove the user from all cached objects */
    18351835        wp_cache_flush();
  • bp-xprofile.php

     
    838838                $lastname = trim( substr( $fullname, $space, strlen($fullname) ) );
    839839        }
    840840
    841         update_usermeta( $user_id, 'nickname', $fullname );
    842         update_usermeta( $user_id, 'first_name', $firstname );
    843         update_usermeta( $user_id, 'last_name', $lastname );
     841        update_user_meta( $user_id, 'nickname', $fullname );
     842        update_user_meta( $user_id, 'first_name', $firstname );
     843        update_user_meta( $user_id, 'last_name', $lastname );
    844844
    845845        $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
    846846        $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) );
     
    874874 *
    875875 * @package BuddyPress XProfile
    876876 * @param $user_id The ID of the deleted user
    877  * @uses get_usermeta() Get a user meta value based on meta key from wp_usermeta
    878  * @uses delete_usermeta() Delete user meta value based on meta key from wp_usermeta
     877 * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta
     878 * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta
    879879 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user
    880880 */
    881881function xprofile_remove_data( $user_id ) {
    882882        BP_XProfile_ProfileData::delete_data_for_user( $user_id );
    883883
    884884        /* delete any avatar files. */
    885         @unlink( get_usermeta( $user_id, 'bp_core_avatar_v1_path' ) );
    886         @unlink( get_usermeta( $user_id, 'bp_core_avatar_v2_path' ) );
     885        @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
     886        @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
    887887
    888888        /* unset the usermeta for avatars from the usermeta table. */
    889         delete_usermeta( $user_id, 'bp_core_avatar_v1' );
    890         delete_usermeta( $user_id, 'bp_core_avatar_v1_path' );
    891         delete_usermeta( $user_id, 'bp_core_avatar_v2' );
    892         delete_usermeta( $user_id, 'bp_core_avatar_v2_path' );
     889        delete_user_meta( $user_id, 'bp_core_avatar_v1' );
     890        delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
     891        delete_user_meta( $user_id, 'bp_core_avatar_v2' );
     892        delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
    893893}
    894894add_action( 'wpmu_delete_user', 'xprofile_remove_data', 1 );
    895895add_action( 'delete_user', 'xprofile_remove_data', 1 );
  • bp-groups/bp-groups-classes.php

     
    742742
    743743                groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) );
    744744
    745                 $group_count = get_usermeta( $this->user_id, 'total_group_count' );
     745                $group_count = get_user_meta( $this->user_id, 'total_group_count', true );
    746746                if ( !empty( $group_count ) )
    747                         update_usermeta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
     747                        update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );
    748748
    749749                return $this->save();
    750750        }
     
    756756                $this->is_banned = 0;
    757757
    758758                groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) );
    759                 update_usermeta( $this->user_id, 'total_group_count', (int)get_usermeta( $this->user_id, 'total_group_count' ) + 1 );
     759                update_user_meta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    760760
    761761                return $this->save();
    762762        }
  • bp-groups/bp-groups-notifications.php

     
    88
    99        $user_ids = BP_Groups_Member::get_group_member_ids( $group->id );
    1010        foreach ( (array)$user_ids as $user_id ) {
    11                 if ( 'no' == get_usermeta( $user_id, 'notification_groups_group_updated' ) ) continue;
     11                if ( 'no' == get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue;
    1212
    1313                $ud = bp_core_get_core_userdata( $user_id );
    1414
     
    4444
    4545        bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id );
    4646
    47         if ( 'no' == get_usermeta( $admin_id, 'notification_groups_membership_request' ) )
     47        if ( 'no' == get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
    4848                return false;
    4949
    5050        $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
     
    9393        else
    9494                bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' );
    9595
    96         if ( 'no' == get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) )
     96        if ( 'no' == get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
    9797                return false;
    9898
    9999        $group = new BP_Groups_Group( $group_id );
     
    151151        // Post a screen notification first.
    152152        bp_core_add_notification( $group_id, $user_id, 'groups', $type );
    153153
    154         if ( 'no' == get_usermeta( $user_id, 'notification_groups_admin_promotion' ) )
     154        if ( 'no' == get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
    155155                return false;
    156156
    157157        $group = new BP_Groups_Group( $group_id );
     
    199199                // Post a screen notification first.
    200200                bp_core_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' );
    201201
    202                 if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) )
     202                if ( 'no' == get_user_meta( $invited_user_id, 'notification_groups_invite', true ) )
    203203                        return false;
    204204
    205205                $invited_ud = bp_core_get_core_userdata($invited_user_id);
     
    258258                        continue;
    259259
    260260                // Now email the user with the contents of the message (if they have enabled email notifications)
    261                 if ( 'no' != get_usermeta( $user_id, 'notification_activity_new_mention' ) ) {
     261                if ( 'no' != get_user_meta( $user_id, 'notification_activity_new_mention', true ) ) {
    262262                        $poster_name = bp_core_get_user_displayname( $poster_user_id );
    263263
    264264                        $message_link = bp_activity_get_permalink( $activity_id );