Title: Problem with saving post terms
Last modified: May 30, 2022

---

# Problem with saving post terms

 *  [wesolowski](https://wordpress.org/support/users/wesolowski/)
 * (@wesolowski)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/problem-with-saving-post-terms/)
 * Hi,
    I have a problem with saving terms in post. I creating post in php like 
   this ` $newPost[‘post_title’] = “sample name”; $newPost[‘post_excerpt’] = “sample
   excerpt”; $newPost[‘post_content’] = “sample content”; $newPost[‘post_status’]
   = ‘publish’; $newPost[‘post_author’] = $author; //id of author $newPost[‘post_type’]
   = ‘post’; $newPost[‘post_category’] = //id of category depends on lang; $ID =
   wp_insert_post($newPost); pll_set_post_language($ID, $lang); //lang code declarated
   earlier
 * in default page lang I have category but on other lang we haven’t any category.
   Could you give me any tips?
 * PHP8
    WP6 Polylang 3.2.2

The topic ‘Problem with saving post terms’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [wesolowski](https://wordpress.org/support/users/wesolowski/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/problem-with-saving-post-terms/)
 * Status: not resolved