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'm trying to create a forum system using WP's custom post types - two post types as Topic/Reply and a Forum taxonomy.

I have created a singular template for the topic post type, in which I added a reply form. The problem is that when I submit the form I get a 404 page.

This is the form template:

<div class="topic-reply-form">
  <form method="post" name="topic-reply-form" class="topic-reply-form clear-block" action="<?php echo home_url('/'); ?>">
    <p><?php _ae("Add reply"); ?></p>
    <fieldset>
       <textarea id="reply-content" name="content" cols="50" rows="6"></textarea>
       <input type="hidden" name="topic" value="<?php the_ID(); ?>" />
       <?php wp_nonce_field('new-topic-reply'); ?>
       <input type="submit" value="Publish" id="reply-submit" name="reply-submit" />
    </fieldset>
 </form>
</div>

Any ideas why this is happening?

share|improve this question
    
Please add your solution as answer so question can be properly resolved. –  Rarst Feb 15 '11 at 19:13

2 Answers 2

FYI to anyone else who finds this, also be mindful of how you name your nonces. If there's a conflict WP won't recognize the logic in your page that verifies the nonce. It'll give you a 404.

Not fun.

share|improve this answer
up vote 2 down vote accepted

it was the "topic" name field. It seems you can't use reserved terms in $_POST, and "topic" is a post type name, so its probably one of them...

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.