I've never actually written a Wordpress plugin before, so this is my first crack at it.
Basically, the plugin is for multi-author blogs where post authors must submit their post for review. The Editor/Administrator must come in and approve and publish/schedule the post. All of this is good, and built into Wordpress.
This plugin adds the ability for the Editor/Administrator to leave a comment on the post content, not suggestions for improving the post. This is particularly useful when the Editor schedules the post to publish at a future date/time.
The Editor can leave their comment, then when the post publishes, the editor's comment automatically publishes with it.
- I have created a custom meta box with a textarea following this method - Add A Meta Box In WordPress
- I have set the form to save to the database and publish when the post is published using - How can I allow editors to leave comments on posts that have not yet been published?
The final thing I cannot figure out is how to make this plugin active only for editor and administrator roles. I do not want the post author to be able to leave comments before the post is published.
Essentially, I don't want to require the post editor, who has already read the post, to come back later to leave his/her comments.
Pastebin of complete code - http://pastebin.com/yG9uqJ7q