WordPress.org

Ready to get started?Download WordPress

Forums

Inserting post remotely (1 post)

  1. shyfool81
    Member
    Posted 5 years ago #

    hi there.. i am writing a form to submit a post without logging in.

    So the submitters can fill in title, post, and choose categories.

    Everything works fine except for the choosing categories part..

    At my form i write:

    ....
    Category:<select multiple="multiple" name="category[]">
    <option value="1">Category 1</option>
    <option value="2">Category 2</option>
    <option value="3">Category 3</option>
    <option value="4">Category 4</option>
    </select>
    ...

    that means, submitters can choose more than 1 categories.

    and at remotePost.php

    ...
    $post['post_status'] = 'draft';
    $post['post_content'] = $_POST['content'];
    $post['post_title'] = $_POST['title'];
    ???$post['post_category'] = $_POST['category']; ????
    ...

    I'm lil bit lost here.. can anybody show me how to insert the array of categories?

Topic Closed

This topic has been closed to new replies.

About this Topic