Skip to content

Commit 5ff8a55

Browse files
pfefferleobenland
andcommitted
Update includes/collection/class-remote-actors.php
Co-authored-by: Konstantin Obenland <[email protected]>
1 parent a94549a commit 5ff8a55

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

includes/collection/class-remote-actors.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,8 @@ public static function get_avatar_url( $id ) {
699699
* @return string|null The cached avatar URL, or null if no avatar.
700700
*/
701701
private static function cache_avatar( $post_id, $actor ) {
702-
if ( \is_array( $actor ) || ( \is_object( $actor ) && ! $actor instanceof Actor ) ) {
703-
$remote_avatar_url = object_to_uri( $actor['icon'] ?? ( $actor->icon ?? null ) );
704-
} else {
705-
$remote_avatar_url = object_to_uri( $actor->get_icon() );
706-
}
702+
$data = $actor instanceof Actor ? $actor->to_array() : (array) $actor;
703+
$remote_avatar_url = object_to_uri( $data['icon'] ?? null );
707704

708705
if ( empty( $remote_avatar_url ) ) {
709706
// No avatar to save, clean up any existing avatar.

0 commit comments

Comments
 (0)