bbPress

Simple, Fast, Elegant

bbPress support forums » Requests and Feedback

Custom fields

(4 posts)
  • Started 1 year ago by shaziamistry
  • Latest reply from shaziamistry

No tags yet.

  1. I need to add an additional field to the "post topic" form. So I want 'title', 'post', 'tags', and one additional field. Is this possible? and if so - how?
    thanks.

    Posted 1 year ago #
  2. You can use a hook to add an input field. Your code would look something like this:

    add_action('post_form', 'addmyinputfield');
    
    function addmyinputfield() {
    echo '<input type="text" name="mine" id="mine" />';
    }

    You would need another hook to then get the value when it's been posted. I'm not sure about this one, but I think the hook would be pre_post. Again you use it in the same way as above: add_action('hook_name', 'function_name'); There's a list of hooks here, http://bbpulp.org/wiki/API/actions if that wasn't the one you wanted. Maybe post_form_pre_post?

    Posted 1 year ago #
  3. and you can catch this field in bb_post.php action to process the post.

    Posted 1 year ago #
  4. thanks a lot! I'll try it out, hopefully it works out.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.