[英]3rd size Avatar in Buddypress
下面是bp-core-avatars.php文件(第375行)。
/ ** *首先查找上傳的頭像。 如果存在,請使用它。 *設置要搜索的文件名,以選擇完整尺寸*或縮略圖。 * /
$avatar_size = ( ‘full’ == $type ) ? ‘-bpfull’ : ‘-bpthumb’;
$legacy_user_avatar_name = ( ‘full’ == $type ) ? ‘-avatar2′ : ‘-avatar1′;
$legacy_group_avatar_name = ( ‘full’ == $type ) ? ‘-groupavatar-full’ : ‘-groupavatar-thumb’;
在上面寫着$ avatar_size的那一行,我需要第三個選項'-bptinythumb'size。 基本上是在“ -bpfull”,“-bpthumb”和“ -bptinythumb”之間進行選擇。
我怎么做?
您將更改$avatar_size = ( 'full' == $type ) ? '-bpfull' : '-bpthumb;
$avatar_size = ( 'full' == $type ) ? '-bpfull' : '-bpthumb;
至:
if ($type == 'full' ) {
$avatar_size = '-bpfull';
} elseif ($type == 'thumb' ) {
$avatar_size = '-bpthumb';
} else {
$avatar_size = '-bptinythumb';
}
但是不建議采用這種方法,因為在升級BuddyPress時,所做的更改將丟失。
小拇指將是默認的頭像大小。 如果你想用拇指或完整版本,那么你就需要通過thumb
或full
向bp_core_fetch_avatar
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.