I have a custom tag plugin that I am writing and I want it to directly edit the post in the database. I want this to happen when the post is created and whenever it is edited.
This way once you use the custom tag the results are saved in the post and the tag disapears leaving the reformatted text.
I have surmised that I need to run the plugin as an action like so:
The issue is that the publish_post and edit_post hooks return the post id. What is the best way to access the content of the database for the post? Is there a global database connection object I can use to run my query against? How is it best used for backwards compatibility?