Forums

post_category NOT WORKING (4 posts)

  1. lobas
    Member
    Posted 3 years ago #

    I have a script that's making a custom post from a .csv file

    Their is a row called Category where i set the post category, but the script just sets the category to uncatagorized. it used to work on old wordpress im sure

    the code is

    $my_post['post_category'] = prep($row['category']);

    anybody know a fix for this?

  2. sojweb
    Member
    Posted 3 years ago #

    No one's going to be able to help you without seeing the script, but it looks like it relies on the old category system, which hasn't been used for a couple years. Your script probably needs to be substantially rewritten.

  3. lobas
    Member
    Posted 3 years ago #

  4. sojweb
    Member
    Posted 3 years ago #

    Change:

    $my_post['post_category'] = prep($row['category']);

    to:

    $my_post['post_category'] = array(prep($row['category']));

Topic Closed

This topic has been closed to new replies.

About this Topic