Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当有人编辑其他人创建的帖子并更改帖子的作者时,整个站点中为该帖子显示的头像是否可以更改以反映新指定的作者?
似乎 Wordpress 总是希望显示创建帖子的用户的头像,无论作者在事后可能已更改为谁。
最后一位作者保存在(隐藏的)帖子元字段中_edit_last,因此您可以执行以下操作:
_edit_last
$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 );