Skip to:
Content

BuddyPress.org

Changeset 3232 for trunk/bp-xprofile.php


Ignore:
Timestamp:
09/06/2010 04:24:57 PM (14 years ago)
Author:
apeatling
Message:

Merging 1.2 branch with trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile.php

    r2946 r3232  
    1616 * @uses site_url() Returns the site URL
    1717 */
     18
    1819function xprofile_setup_globals() {
    1920    global $bp, $wpdb;
     
    136137            <li><a href="<?php echo $bp->displayed_user->domain . $bp->profile->slug ?>/change-avatar/"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), attribute_escape( $bp->displayed_user->fullname ) ) ?></a></li>
    137138<?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?>
    138 
    139139            <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Mark as Spammer", 'buddypress' ) ?></a></li>
    140140<?php else : ?>
     
    235235        }
    236236
    237         if ( !empty( $errors ) )
     237        if ( $errors )
    238238            bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' );
    239239        else {
     
    249249            }
    250250
    251             do_action( 'xprofile_updated_profile', $bp->displayed_user->id, $posted_field_ids, $errors );
     251            do_action( 'xprofile_updated_profile', $posted_field_ids, $errors );
    252252
    253253            /* Set the feedback messages */
     
    642642        return false;
    643643
    644     /* If the value is empty, then delete any field data that exists */
    645     if ( empty( $value ) ) {
    646         xprofile_delete_field_data( $field_id, $user_id );
    647         return true;
    648     }
    649 
    650644    $field = new BP_XProfile_Field( $field_id );
    651645
     
    693687        $field_id = xprofile_get_field_id_from_name( $field );
    694688
    695     if ( empty( $field_id ) || empty( $user_id ) )
    696         return false;
    697 
    698     $field = new BP_XProfile_ProfileData( $field_id, $user_id );
     689    if ( !$field_id )
     690        return false;
     691
     692    $field = new BP_XProfile_ProfileData( $field_id );
    699693    return $field->delete();
    700694}
     
    882876    BP_XProfile_ProfileData::delete_data_for_user( $user_id );
    883877
    884     /* 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' ) );
    887 
    888     /* 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' );
     878    // delete any avatar files.
     879    @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
     880    @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
     881
     882    // unset the usermeta for avatars from the usermeta table.
     883    delete_user_meta( $user_id, 'bp_core_avatar_v1' );
     884    delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
     885    delete_user_meta( $user_id, 'bp_core_avatar_v2' );
     886    delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
    893887}
    894888add_action( 'wpmu_delete_user', 'xprofile_remove_data' );
Note: See TracChangeset for help on using the changeset viewer.