以下代码在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’之间选择。
我该怎么做?
发布于 2014-03-09 15:01:52
您可以将$avatar_size = ( ‘full’ == $type ) ? ‘-bpfull’ : ‘-bpthumb;更改为:
if ($type == 'full' ) {
$avatar_size = '-bpfull';
} elseif ($type == 'thumb' ) {
$avatar_size = '-bpthumb';
} else {
$avatar_size = '-bptinythumb';
}但不推荐使用这种方法,因为当您升级BuddyPress时,您所做的更改将会丢失。
小拇指将是默认的头像大小。如果您想使用thumb或完整版,则需要将thumb或full传递给bp_core_fetch_avatar
https://stackoverflow.com/questions/22278810
复制相似问题