Debug ideas:
您可以尝试看看这是否有任何影响:
add_filter( \'bp_core_fetch_avatar_no_grav\', \'__return_true\' );
但您应该检查通过
bp_core_fetch_avatar
过滤以查看它们是否正确(未测试):
add_filter( \'bp_core_fetch_avatar\', \'my_bp_core_fetch_avatar\', 99, 9 );
function my_bp_core_fetch_avatar( $html, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir )
{
// debug:
$args = array(
\'html\' => $html,
\'params\' => join( \', \', $params ),
\'item_id\' => $item_id,
\'avatar_dir\' => $avatar_dir,
\'css_id\' => $css_id,
\'html_width\' => $html_width,
\'html_height\' => $html_height,
\'avatar_folder_url\' => $avatar_folder_url,
\'avatar_folder_dir\' => $avatar_folder_dir,
);
$debug = date_i18n( \'c\' );
foreach( $args as $key => $value )
{
$debug .= sprintf( \' | %s: %s \', $key, $value );
}
error_log( $debug . PHP_EOL , 3, \'/path/to/my/debug.log\' );
return $html;
}
您必须修改可写文件的路径
debug.log
文件
然后,该文件应包含以下行:
2013-11-12T12:01:16+00:00 | html: ??? | params: ??? | item_id: ??? | avatar_dir: ??? | css_id: ??? | html_width: ??? | html_height: ??? | avatar_folder_url: ??? | avatar_folder_dir: ???
我更新了上面的调试代码,以考虑到
$params
是一个数组。
Some general remarks:
查看文件很有趣
/bp-core/bp-core-avatars.php
.
化身图像似乎通过此过滤器被覆盖:
add_filter( \'get_avatar\', \'bp_core_fetch_avatar_filter\', 10, 5 );
在
bp_core_fetch_avatar_filter()
回调您有以下行:
// Let BuddyPress handle the fetching of the avatar
$bp_avatar = bp_core_fetch_avatar( array( \'item_id\' => $id, \'width\' => $size, \'height\' => $size, \'alt\' => $alt ) );
在这个函数中,我发现
bp_core_fetch_avatar
滤器
因此,我认为这些功能可能值得进一步调试,或者您可以尝试通过上面的bp_core_fetch_avatar
滤器