I’m using this code:
$post = array(
'post_content' => $desc,
'post_title' => $name_new,
'post_status' => 'publish',
'post_type' => 'portfolio_page',
'tax_input' => array('portfolio_category' => array($cat, 18, 19))
);
if (!$post_id = wp_insert_post($post)) {
die('Error');
}
which is working perfectly when executed via web browser. Unfortunately I need to execute it via shell, and what is happening is the post is inserted but the tax_input is ignored.
Any suggestion?
thanks a lot