Categories
PHP WordPress

Get translated permalink with WPML

For WPML 3.2+ correct version for translating permalinks is

Documentation for wpml_object_id

For versions older than 3.2 you can use version below

Parameters for icl_object_id are:

  • Term id for taxonomies, post id for posts and pages
  • Element type ie. comment, post or page
  • Return original value if translation is missing. Defaults to true
  • Language code, if missing will use the current language.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.