Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom fields


  • shaziamistry
    Member

    @shaziamistry

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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?


    so1o
    Participant

    @so1o

    and you can catch this field in bb_post.php action to process the post.


    shaziamistry
    Member

    @shaziamistry

    thanks a lot! I’ll try it out, hopefully it works out.

    Note, for anyone poking around in here looking for documentation (wouldn’t that be great?): bb_post.php as an action has been replaced by bb-post.php — that one had been biting me in sensitive places for a little while now.


    beezeeking
    Participant

    @beezeeking

    Is there a plugin to let it come true?i think this is useful function

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar