Changeset 3232 for trunk/bp-xprofile.php
- Timestamp:
- 09/06/2010 04:24:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile.php
r2946 r3232 16 16 * @uses site_url() Returns the site URL 17 17 */ 18 18 19 function xprofile_setup_globals() { 19 20 global $bp, $wpdb; … … 136 137 <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> 137 138 <?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?> 138 139 139 <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> 140 140 <?php else : ?> … … 235 235 } 236 236 237 if ( !empty( $errors ))237 if ( $errors ) 238 238 bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' ); 239 239 else { … … 249 249 } 250 250 251 do_action( 'xprofile_updated_profile', $ bp->displayed_user->id, $posted_field_ids, $errors );251 do_action( 'xprofile_updated_profile', $posted_field_ids, $errors ); 252 252 253 253 /* Set the feedback messages */ … … 642 642 return false; 643 643 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 650 644 $field = new BP_XProfile_Field( $field_id ); 651 645 … … 693 687 $field_id = xprofile_get_field_id_from_name( $field ); 694 688 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 ); 699 693 return $field->delete(); 700 694 } … … 882 876 BP_XProfile_ProfileData::delete_data_for_user( $user_id ); 883 877 884 / * delete any avatar files. */885 @unlink( get_user meta( $user_id, 'bp_core_avatar_v1_path') );886 @unlink( get_user meta( $user_id, 'bp_core_avatar_v2_path') );887 888 / * unset the usermeta for avatars from the usermeta table. */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' );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' ); 893 887 } 894 888 add_action( 'wpmu_delete_user', 'xprofile_remove_data' );
Note: See TracChangeset
for help on using the changeset viewer.