I have my Wordpress page set up so that the administrator must approve/Publish a post. As a post is Published I would like to also generate a number and save it along with the post (this only happens when the admin hits Publish). I used "Custom Fields" to create the appropriate data field which is only visible in the administrator edit post page.
Where in the code would I modify it so that only on "Publish" I get the number and then insert it into the databases?