You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When post is published or updated we need to check if a new activity needs to be added, for that reason we hook into post_updated and wp_insert_post hooks and we have separate callbacks for them.
wp_insert_post is fired when post is inserted for the first time, but when post is updated both the post_updated and wp_insert_post are fired which makes both callbacks needlessly.
Quick fix would be to use the third parameter in the wp_insert_post ( (bool) $updated) and merge both callbacks in one function, something like this.
The text was updated successfully, but these errors were encountered:
When post is published or updated we need to check if a new activity needs to be added, for that reason we hook into
post_updated
andwp_insert_post
hooks and we have separate callbacks for them.wp_insert_post
is fired when post is inserted for the first time, but when post is updated both thepost_updated
andwp_insert_post
are fired which makes both callbacks needlessly.Quick fix would be to use the third parameter in the
wp_insert_post
( (bool) $updated) and merge both callbacks in one function, something like this.The text was updated successfully, but these errors were encountered: