I would like to run a filter on post content after it has been created or updated.
I would like this to occur after the user has submitted the post, as it may be a bit of a lengthy process (a find/replace to search for glossary terms and replace them with links).
What’s the most efficient and reliable way to achieve this?
Thanks in advance,
Alright, here’s some code I just whipped up. Completely untested, just wrote it right off the cuff…so don’t expect it to work 100% when you drop it in, but the core concept is there, as is a decent amount of the legwork
Please see my answer here. It’s a proof-of-concept for running a native crontab in Linux with your WP installation.
As for WP-Cron functionality, beware of these caveats:
If you choose to go the WP-Cron route, here’s a great article to show you how to use it. You can also check out the WP functions in the Codex here.
I prefer the reliability of a Linux crontab, especially for integral, heavy-weight cron scripts. For extremely lightweight scripts, I do use WP-Cron at times.
Hope this helps!
Would the save_post action work for you?
You might also consider edit_post or publish_post
You can view other actions in the Codex