将此添加到子主题的函数中。php。
function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
if ( $activity->component = \'friends\' ) {
// Only insert avatar if one exists
if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
$reverse_content = strrev( $action );
$position = strpos( $reverse_content, \'a<\' );
$action = substr_replace( $action, $secondary_avatar, -$position - );
}
break;
}
return $action;
}
add_filter( \'bp_get_activity_action_pre_meta\', \'bp_dtheme_activity_secondary_avatars\', 10, 2 );
它将覆盖bp的默认设置,仅当活动是好友更新时(例如,Bob与Joe成为好友)才会显示第二个头像