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 need public users to be able to submit posts, then have them be approved by a moderator or admin on the dashboard. Is this possible to do? I would like it to function very similarly to comments.

for example, users will post their own stories and then a moderator will approve it being posted.

I am new to this particular stackexchange (I use stackoverflow often) and wordpress development, so forgive me if this seems like a stupid question.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If you don't want to give users access to the WordPress admin screens and you don't want to use a premium plugin, you should create a form in a page and use wp_insert_post with the submitted data.

In your case, the "post_status" parameter could be used to "moderate":

$post = array(
    'post_title'   => $_POST['title_field'],
    'post_content' => $_POST['content_field'],
    'post_status'  => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' | custom registered status ] //Set the status of the new post.
);

wp_insert_post($post);

The wp_insert_post function should take care of sanitizing the data before inserting it into the DB, but I recommend to double check and add filters if necessary.

share|improve this answer
    
I think you have to register_post_status() first. –  Max Yudin Feb 8 '13 at 18:49
    
@gyo would I create a separate PHP file to handle this form action and contain this code? Also, do I need to use register_post_status() as Max indicated? And if so, where would I put that? –  Ethan Feb 8 '13 at 18:55
    
Yep, use "register_post_status" for custom "statuses", not necessary if you use "draft". I'd submit the form via Ajax, or alternatively in your page-template place the logic inside an if (isset($_POST)) block. –  gyo Feb 8 '13 at 19:07
    
Excellent. Thank you! –  Ethan Feb 8 '13 at 19:09
    
Accept the answer if you think the problem is solved, cheers! –  gyo Feb 8 '13 at 19:46

The only plugin that I know of that supports this is Gravity Forms.

This tutorial should also be mostly relevant. http://yoast.com/gravity-forms-custom-post-types/

share|improve this answer

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.