79581739

Date: 2025-04-18 21:20:45
Score: 0.5
Natty:
Report link

Before update, first get the original author id:

$author= get_post_field('post_author', $post_id);

then switch the current user to author

   wp_set_current_user($author);

Next update the post.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Hossein Shourabi