• Hello chouby!

    I am going to migrate my multilanguage site to WordPress and I want to use Polylang. I wrote a number of scripts to automatically convert the site’s content but I don’t know how to automatically create translations. Is there any API function like add_translation() or something?

    Thanks!

    http://ww.wp.xz.cn/extend/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    There is currently no documented API function to do this. However, you can look at the code in include/base.php and look for the functions save_translations, set_post_language, set_term_language. you can access them with $polylang->save_translations (for example), $polylang beeing a global variable. I hope the comments are sufficient to know how to use the functions. NB: $type is ‘post’ for all post types and ‘term’ for all taxonomies.

    Thread Starter Mitsugari Yamamoto

    (@mityama)

    Thans, Chouby, that should be sufficient. 🙂

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

The topic ‘Polylang API function to add translation?’ is closed to new replies.