Changeset 6022 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 05/11/2012 05:38:50 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r5956 r6022 15 15 function bp_core_set_avatar_constants() { 16 16 global $bp; 17 17 18 18 if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) 19 19 define( 'BP_AVATAR_THUMB_WIDTH', 50 ); … … 113 113 114 114 /** Set item_id ***********************************************************/ 115 115 116 116 if ( empty( $item_id ) ) { 117 117 … … 130 130 131 131 break; 132 132 133 133 case 'user' : 134 134 default : … … 145 145 146 146 $class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params ); 147 147 148 148 /** Set avatar_dir ********************************************************/ 149 149 … … 164 164 165 165 break; 166 166 167 167 case 'user' : 168 168 default : … … 181 181 182 182 if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) { 183 183 184 184 // Get item name for alt/title tags 185 185 $item_name = ''; … … 194 194 $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) ); 195 195 break; 196 196 197 197 case 'user' : 198 198 default : … … 207 207 /** Sanity Checks *********************************************************/ 208 208 209 // Get a fallback for the 'alt' parameter 209 // Get a fallback for the 'alt' parameter 210 210 if ( empty( $alt ) ) 211 211 $alt = __( 'Avatar Image', 'buddypress' ); … … 727 727 function bp_core_avatar_upload_path() { 728 728 global $bp; 729 729 730 730 // See if the value has already been calculated and stashed in the $bp global 731 731 if ( isset( $bp->avatar->upload_path ) ) { … … 740 740 switch_to_blog( bp_get_root_blog_id() ); 741 741 } 742 742 743 743 // Get upload directory information from current site 744 744 $upload_dir = wp_upload_dir(); 745 745 746 746 // Directory does not exist and cannot be created 747 747 if ( !empty( $upload_dir['error'] ) ) { 748 748 $basedir = ''; 749 749 750 750 } else { 751 751 $basedir = $upload_dir['basedir']; 752 752 } 753 753 754 754 // Will bail if not switched 755 755 restore_current_blog(); 756 756 } 757 757 758 758 // Stash in $bp for later use 759 759 $bp->avatar->upload_path = $basedir; 760 760 } 761 761 762 762 return apply_filters( 'bp_core_avatar_upload_path', $basedir ); 763 763 } … … 773 773 function bp_core_avatar_url() { 774 774 global $bp; 775 775 776 776 // See if the value has already been calculated and stashed in the $bp global 777 777 if ( isset( $bp->avatar->url ) ) { … … 785 785 // Get upload directory information from current site 786 786 $upload_dir = wp_upload_dir(); 787 787 788 788 // Directory does not exist and cannot be created 789 789 if ( !empty( $upload_dir['error'] ) ) { 790 790 $baseurl = ''; 791 791 792 792 } else { 793 793 $baseurl = $upload_dir['baseurl']; … … 841 841 function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { 842 842 global $bp; 843 843 844 844 $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false; 845 845 846 846 return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w ); 847 847 } … … 905 905 function bp_core_avatar_original_max_width() { 906 906 global $bp; 907 907 908 908 return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width ); 909 909 } … … 919 919 function bp_core_avatar_original_max_filesize() { 920 920 global $bp; 921 921 922 922 return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize ); 923 923 } … … 933 933 function bp_core_avatar_default() { 934 934 global $bp; 935 935 936 936 return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default ); 937 937 } … … 947 947 function bp_core_avatar_default_thumb() { 948 948 global $bp; 949 949 950 950 return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default ); 951 951 }
Note: See TracChangeset
for help on using the changeset viewer.