pll_save_term_translations

Save terms translations.

Description

pll_save_term_translations( (array) $arr ); 

Parameters (1)

0. $arr (array)
An associative array of translations with language code as key and term id as value

Usage

  1. if ( !function_exists( 'pll_save_term_translations' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'polylang/include/api.php'; 
  3.  
  4. // an associative array of translations with language code as key and term id as value 
  5. $arr = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pll_save_term_translations($arr); 
  9.  

Defined (1)

The function is defined in the following location(s).

/include/api.php  
  1. function pll_save_term_translations( $arr ) { 
  2. PLL()->model->term->save_translations( reset( $arr ), $arr );