Changeset 13215 for trunk/src/bp-activity/bp-activity-template.php
- Timestamp:
- 01/19/2022 09:21:45 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r13181 r13215 1463 1463 // Set generated content properties. 1464 1464 if ( 'new_avatar' === $activity_type ) { 1465 $avatars = bp_avatar_get_version( $user_id, 'user', bp_get_activity_date_recorded() ); 1466 1467 if ( $avatars && 1 === count( $avatars ) ) { 1468 $avatar = reset( $avatars ); 1469 $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name; 1470 1471 // Add historical avatar to the current activity. 1465 $avatars = array(); 1466 1467 // Use the avatar history to display the avatar that was in use at the time the activity was posted. 1468 if ( ! bp_avatar_history_is_disabled() ) { 1469 $avatars = bp_avatar_get_version( $user_id, 'user', bp_get_activity_date_recorded() ); 1470 1471 if ( $avatars && 1 === count( $avatars ) ) { 1472 $avatar = reset( $avatars ); 1473 $historical_avatar = trailingslashit( $avatar->parent_dir_url ) . $avatar->name; 1474 1475 // Add historical avatar to the current activity. 1476 $generated_content->user_profile_photo = array( 1477 'value' => $historical_avatar, 1478 'sanitize_callback' => 'esc_url', 1479 ); 1480 } 1481 1482 // Otherwise use the current/latest avatar. 1483 } else { 1472 1484 $generated_content->user_profile_photo = array( 1473 'value' => $historical_avatar, 1485 'value' => bp_core_fetch_avatar( 1486 array( 1487 'item_id' => $user_id, 1488 'object' => 'user', 1489 'type' => 'full', 1490 'width' => bp_core_avatar_full_width(), 1491 'height' => bp_core_avatar_full_height(), 1492 'html' => false, 1493 ) 1494 ), 1474 1495 'sanitize_callback' => 'esc_url', 1475 1496 ); 1476 1477 // Do not use a generated content.1478 } else {1479 return false;1480 1497 } 1481 1498 }
Note: See TracChangeset
for help on using the changeset viewer.