Support

Account

Home Forums Front-end Issues Update post field Reply To: Update post field

  • It should look something like this

    
    $my_post['tax_input'] = array(
      'category' => array(
        get_field('categorie', $post_id)
      )
    );
    

    see https://developer.wordpress.org/reference/functions/wp_insert_post/. Each element of ‘tax_input’ is an array. The key is the taxonomy name and the value is an array of term IDs.

    Although I’m not 100% sure that tax_input works with wp_update_post. You may need to use wp_set_object_terms() https://developer.wordpress.org/reference/functions/wp_set_object_terms/