File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -47,17 +47,22 @@ public static function pre_get_avatar_data( $args, $id_or_email ) {
4747 return $ args ;
4848 }
4949
50- $ avatar = null ;
50+ // Respect WordPress "show avatars" setting.
51+ if ( ! \get_option ( 'show_avatars ' ) ) {
52+ $ avatar = ACTIVITYPUB_PLUGIN_URL . 'assets/img/mp.jpg ' ;
53+ } else {
54+ $ avatar = null ;
5155
52- // First, try to get avatar from remote actor.
53- $ remote_actor_id = \get_comment_meta ( $ id_or_email ->comment_ID , '_activitypub_remote_actor_id ' , true );
54- if ( $ remote_actor_id ) {
55- $ avatar = Remote_Actors::get_avatar_url ( $ remote_actor_id );
56- }
56+ // First, try to get avatar from remote actor.
57+ $ remote_actor_id = \get_comment_meta ( $ id_or_email ->comment_ID , '_activitypub_remote_actor_id ' , true );
58+ if ( $ remote_actor_id ) {
59+ $ avatar = Remote_Actors::get_avatar_url ( $ remote_actor_id );
60+ }
5761
58- // Fall back to avatar_url comment meta for backward compatibility.
59- if ( ! $ avatar ) {
60- $ avatar = \get_comment_meta ( $ id_or_email ->comment_ID , 'avatar_url ' , true );
62+ // Fall back to avatar_url comment meta for backward compatibility.
63+ if ( ! $ avatar ) {
64+ $ avatar = \get_comment_meta ( $ id_or_email ->comment_ID , 'avatar_url ' , true );
65+ }
6166 }
6267
6368 if ( $ avatar ) {
You can’t perform that action at this time.
0 commit comments