Submit new post to discourse when post is published or updated

This will trigger a sync if the post status is published, publish to discourse is checked, whenever the post is published or updated.
It should also work for scheduled posts, but I haven't checked this yet.

NB: The function name is a little bit awkward, you might want to change it to something else.