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 now developing a wordpress site that will be something like a directory. People will be able to submit walkthroughs, advanced reviews, as well as cheat codes for games. We were going to make a different form for each page, but now we've decided that one form with a drop down will be just fine.

There doesn't seem to be a good plug in out there, that I can find, which accommodates the fact that each submission needs to be pushed through as a "pending post" but also to a certain post type.

For example, the form that we'll use will be set up like this:

Game name: <post title>
Platform:  <Taxonomy>
Category:  <Category> (role playing, FPS, adventure, etc..)
This is a: () Review () Tutorial () Cheat list  <this is the post type>
Content: <post body>
Tags: <tags>
[Submit]

Upon submission, I need for the review, cheat, or tutorial to be set as a pending post, in the post type chosen from the radio boxes.

I'm currently using WP User Front End, but I could probably use any post from front-end form that is suggested for easiest modification. Adding the new fields to the form is easy, making them do stuff is hard! I'd appreciate any help I can get with this, our website sort of revolves around these feature.

share|improve this question
    
Also, purchasing software isn't an issue as long as the price is right. We bought Formidable forms because they boast a rich text editor, but I could not find a setting that set submissions as pending posts, let alone with a Post Type. –  Lynne Feb 26 '11 at 17:11
add comment

2 Answers

up vote 4 down vote accepted

It looks like Gravity Forms can do this. I just did a quick search on the support forums and found this, an answer to someone asking almost exactly the same question as you:

Gravity Forms can be used to create custom post types as well as custom taxonomies, however it doesn't do so out of the box. It requires the use of available hooks to tell Gravity Forms to use a custom post type or custom taxonomy instead of the default. By default it uses standard WordPress Posts, Categories and Tags.

So yes it is possible, but it does take some custom code. When you are ready to implement this you can search the forums for code examples as many people have done this, or you can post a new post describing what you are trying to do and request some assistance and we can assist you with basic code snippets to get you started.

We do plan on creating an Add-On in the future that will make it much easier to create custom post types and use custom taxonomies.

share|improve this answer
    
Thank you! We got a formidable refund and purchased gravity forms! Hope this works! –  Lynne Feb 26 '11 at 18:08
add comment

there are some free plugins that let you submit posts from frontend:

and a better paid one would be:

But none of them will give you the flexibility as a custom coding to your needs, and really a post from front end is a matter of displaying a form and processing it ,so following your use case your form would be something like this:

<!-- New game Post Form -->
<div id="postbox">
<form id="new_post" name="new_post" method="post" action="">

<!-- game name -->
<p><label for="title">Game name</label><br />
<input type="text" id="title" value="" tabindex="1" size="20" name="title" />
</p>

<!-- game platform assuming that the taxonomy is named platform -->
<p><label for="Platform">Platform:</label><br />
<p><?php wp_dropdown_categories( 'show_option_none=Platform&tab_index=4&taxonomy=platform' ); ?></p>

<!-- game Category -->
<p><label for="Category">Category:</label><br />
<p><?php wp_dropdown_categories( 'show_option_none=Category&tab_index=4&taxonomy=category' ); ?></p>

<!-- game post type assuming that the post types are named: review,tutorial,cheat_list-->
<p><label for="post_type">This is a:</label><br />
<p><select name="post_type" id="post_type">
    <option value="review">Review</option>
    <option value="tutorial">Tutorial</option>
    <option value="cheat_list"> Cheat list</option>
</select></p>

<!-- game Content -->
<p><label for="description">Content</label><br />
<textarea id="description" tabindex="3" name="description" cols="50" rows="6"></textarea>
</p>

<!-- game tags -->
<p><label for="post_tags">Tags:</label>
<input type="text" value="" tabindex="5" size="16" name="post_tags" id="post_tags" /></p>
<p align="right"><input type="submit" value="Publish" tabindex="6" id="submit" name="submit" /></p>

<input type="hidden" name="action" value="new_game_post" />
<?php wp_nonce_field( 'new-post' ); ?>
</form>
</div>

and your form processing would be:

if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_game_post") {

    // Do some minor form validation to make sure there is content
    if (isset ($_POST['title'])) {
        $title =  $_POST['title'];
    } else {
        echo 'Please enter a game  title';
    }
    if (isset ($_POST['description'])) {
        $description = $_POST['description'];
    } else {
        echo 'Please enter the content';
    }
    $tags = $_POST['post_tags'];

    // Add the content of the form to $post as an array
    $new_post = array(
        'post_title'    => $title,
        'post_content'  => $description,
        'post_category' => array($_POST['cat']),  // Usable for custom taxonomies too
        'tags_input'    => array($tags),
        'post_status'   => 'publish',           // Choose: publish, preview, future, draft, etc.
        'post_type' => $_POST['post_type']  // Use a custom post type if you want to
    );
    //save the new post
    $pid = wp_insert_post($new_post); 
    //insert taxonomies
    wp_set_post_terms($pid,array($_POST['Platform']),'platform',true);
}

its not perfect but its a start and you should get the idea.

Hope this helps

share|improve this answer
1  
Thank you! Yet again! My husband has started to call you my boyfriend because you always answer my questions with extraordinary detail and accuracy :p –  Lynne Feb 26 '11 at 18:16
    
Also I like the name change... easier! I'll give this a try. We did buy gravity forms and I found some plugins that might do the trick. Now I feel like I've got a great start. WP stack rocks. –  Lynne Feb 26 '11 at 18:18
    
hamm, I don't know how to reply to that... i guess you just happen to ask good questions when my muse for answering is full on. LOL –  Bainternet Feb 26 '11 at 20:45
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.