I'm writing a little plugin for my website and I need some help. I created a shortcode called [thumbnail], what I need is for the $contents of this shortcode to be passed into a separate function that creates a custom field which has to be done when I hit the publish button (or update post).
So here is an example of what I need
Post Writer enters [thumbnail]URL[/thumbnail]
Writer hits publish
The plugin takes the URL and adds it to a custom field called "thumbnail"
I know how to make custom fields and shortcodes but I don't know how to make them work together. Also I know that I can just have the shortcode function create the custom field but I want the field generated as soon as the post is publish not when the page is loaded.
Can anyone help?