File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments