Title: save_post filter
Last modified: August 31, 2016

---

# save_post filter

 *  [brian1037](https://wordpress.org/support/users/brian1037/)
 * (@brian1037)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/save_post-filter/)
 * Is Polylang available to use in the save_post filter? When calling pll_the_languages()
   within that filter, it returns null. I can copy the code elsewhere and it works,
   so I am sure it’s not a syntax error.
 * Thanks 🙂
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/save_post-filter/#post-7000843)
 * Hi
 * `save_post` is used on the admin side and `pll_the_languages` on the front side
   to display the language switcher. I don’t understand your request. Could you 
   specify what you want to obtain?
 *  Thread Starter [brian1037](https://wordpress.org/support/users/brian1037/)
 * (@brian1037)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/save_post-filter/#post-7000888)
 * Good point. I was using it as part of a bigger function who’s purpose was to 
   synchronize a single meta field between all of the translations of a post. Basically:
 * 1. User saves a post in the WP Admin and the save_post filter is triggered.
 * 2. I use pll_the_languages() to get all of the site languages.
 * 3. For each language, I use pll_get_post() to obtain the translation of the post
   that the user saved.
 * 4. I update the meta field of each post translation.
 * I hadn’t noticed another function that returns off of the site languages, so 
   I used pll_the_languages().
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/save_post-filter/#post-7000908)
 * To synchronize you can use the `pll_copy_post_metas` filter, see: [https://polylang.wordpress.com/documentation/documentation-for-developers/filter-reference/](https://polylang.wordpress.com/documentation/documentation-for-developers/filter-reference/)
 * 2. You can use `pll_languages_list` function, see: [https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/](https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘save_post filter’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Chrystl](https://wordpress.org/support/users/chrystl/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/save_post-filter/#post-7000908)
 * Status: not resolved