Is there a way to trigger the post saving or updating event in code? such as do_action('save_post', $post_id);
The function here seems to imply that a WP_POST object needs to be passed in. Is there a way to basically imitate the action of updating the post with all its existing values. The point is for the other hooks linked to all trigger on post update. Maybe do a wp_insert_post(), just passing in the post id?

https://developer.wordpress.org/reference/hooks/save_post/
do_action( 'save_post', int $post_ID, WP_Post $post, bool $update )

Read more here: trigger save_post event programmatically


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: