Skip to content

Instantly share code, notes, and snippets.

@ville6000
Last active October 28, 2016 20:29
Show Gist options
  • Save ville6000/74d1856b95bc38f068af to your computer and use it in GitHub Desktop.
Save ville6000/74d1856b95bc38f068af to your computer and use it in GitHub Desktop.
Get translated permalink with WPML 3.2+
<?php $object_id = apply_filters( 'wpml_object_id', YOUR-PAGE-ID-HERE, 'page' ); ?>
<a href="<?php echo get_permalink( $object_id ); ?>">
<?php _e( 'Link text', 'text-domain' );
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment