Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Buddypress中的3号头像_Php_Wordpress_Buddypress_Avatar - Fatal编程技术网

Php Buddypress中的3号头像

Php Buddypress中的3号头像,php,wordpress,buddypress,avatar,Php,Wordpress,Buddypress,Avatar,下面是bp-core-avatars.php文件(第375行) /** *首先查找上传的头像。如果存在,请使用它。 *设置要搜索的文件名,以选择完整大小 *或缩略图。 */ 在显示$avatar_size的行中,我需要第三个选项,名为'-bptinythumb'size。基本上是在'-bpfull'、'-bpthumb'和'-bptinythumb'之间进行选择 我该怎么做呢?您需要更改$avatar\u size=('full'=$type')”-bpfull':'-bpthumb至: if

下面是bp-core-avatars.php文件(第375行)

/** *首先查找上传的头像。如果存在,请使用它。 *设置要搜索的文件名,以选择完整大小 *或缩略图。 */

在显示$avatar_size的行中,我需要第三个选项,名为'-bptinythumb'size。基本上是在'-bpfull'、'-bpthumb'和'-bptinythumb'之间进行选择


我该怎么做呢?

您需要更改
$avatar\u 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\u core\u fetch\u avatar

if ($type == 'full' ) {
    $avatar_size = '-bpfull';
} elseif ($type == 'thumb' ) {
    $avatar_size = '-bpthumb';
} else {
    $avatar_size = '-bptinythumb';
}