Changeset 2025 for trunk/bp-core/deprecated/bp-core-deprecated.php
- Timestamp:
- 10/02/2009 10:07:58 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/deprecated/bp-core-deprecated.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/deprecated/bp-core-deprecated.php
r1984 r2025 712 712 } 713 713 714 function bp_core_handle_avatar_upload($file) { 715 global $wp_upload_error; 716 717 require_once( ABSPATH . '/wp-admin/includes/file.php' ); 718 719 // Change the upload file location to /avatars/user_id 720 add_filter( 'upload_dir', 'xprofile_avatar_upload_dir' ); 721 722 $res = wp_handle_upload( $file['file'], array('action'=>'slick_avatars') ); 723 724 if ( !in_array('error', array_keys($res) ) ) { 725 return $res['file']; 726 } else { 727 $wp_upload_error = $res['error']; 728 return false; 729 } 730 } 731 732 function bp_core_resize_avatar( $file, $size = false ) { 733 require_once( ABSPATH . '/wp-admin/includes/image.php' ); 734 735 if ( !$size ) 736 $size = CORE_CROPPING_CANVAS_MAX; 737 738 $canvas = wp_create_thumbnail( $file, $size ); 739 740 if ( $canvas->errors ) 741 return false; 742 743 return $canvas = str_replace( '//', '/', $canvas ); 744 } 714 745 715 746 /*** END OLD AVATAR CROPPING SUPPORT **************************/
Note: See TracChangeset
for help on using the changeset viewer.