tax_input in wp_insert_post partly not working

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.

Topic wp-insert-post Wordpress

Category Web


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'),
),

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.