• Hi,

    I was curious if methods with the wp_ prefix are different from methods without… I am curious because I am have some difficulty with
    wp_insert_term()… It seems I can only insert terms under certain conditions… I am trying to run a loop with a plugin function that inserts new posts from a CSV file and automatically adds the category/subcategory…

    something like:

    foreach($posts as $post){
    $category= $post[‘category’];
    $cat_id= wp_insert_term($category, ‘custom-taxonomy’);
    //Insert post with meta_category => array($cat_id), (something like that)
    }

    This function is not attached to a hook, and it doesn’t seem to insert the term even though everything else works fine… Please help!!!

  • The topic ‘Quick Question’ is closed to new replies.