0

When someone edits a post created by somebody else and changes the author of the post, can the avatar shown for that post throughout the site change to reflect the newly designated author?

It seems like Wordpress always wants to show the avatar of the user who created the post, regardless of who the author may have been changed to after the fact.

robk27
  • 683
  • 1
  • 12
  • 23

1 Answers1

0

The last author is saved in the (hidden) post meta field _edit_last, so you could do something like:

$last_id = get_post_meta( get_queried_object_id(), '_edit_last', true );
$last_user = get_userdata( $last_id );
echo get_avatar( $last_user->user_email );
diggy
  • 6,748
  • 2
  • 18
  • 24