Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a plugin for a WordPress install so lower users can submit a new page or page revision so an Editor can approve it.

I would like to do this by creating this post as a draft, then notifying an Editor via email...

Is this possible?

Thanks in advanced.

share|improve this question
add comment

1 Answer

You can use the function wp_insert_post for this http://codex.wordpress.org/Function_Reference/wp_insert_post

$my_post = array(
   'post_title' => $title,
   'post_content' => $content,
   'post_status' => 'draft',
   'post_type' => 'page',
   'post_author' => $author
);

wp_insert_post( $my_post );

then you can use wp_mail(); to notify someone. http://codex.wordpress.org/Function_Reference/wp_mail

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.