front end radio custom taxonomy with custom post type

Your code doesn’t show if and how you set $terms other then that its seems ok, just try to wrap it in an array and you should check if its set first, so try this:

$new_post = array(
    'post_author' => $user_id,
    'post_title' => $post_title,
    'post_content' => $post_content,
    'post_category' =>   array($_POST['cat']),
    'tags_input' => array($tags),
    'post_type' => 'classified',
    'post_status' => 'publish'
));
if (isset($_POST['tax_input']['offer'])
$new_post['tax_input'] array('offer' => (array)$_POST['tax_input']['offer']);
$post_id = wp_insert_post($new_post);

Leave a Comment