0

I'm inserting a post via wp_insert_post() and in the $args the tax_input looks like this:

'tax_input' => array(
    "programmas" => 'Modern Family',
    "zenders" => 'ABC',
),

But what is happening: the "programmas" is correctly inserted but the "zenders" is not. I'm 100% sure that I've spelled these custom taxonomies correctly. When running the function, a post is correctly inserted except for the "zenders" part.

I have all the capabilities, because I am the administrator and I've inserted my user id in the "post_author" part.

0

Try to append it in array, like this: see this: Insert post with custom taxonomy and post meta data

'tax_input' => array(
    "programmas" => array('Modern Family'),
    "zenders" => array('ABC'),
),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.