Skip to content

Instantly share code, notes, and snippets.

@caralgar
Last active December 8, 2015 00:55
Show Gist options
  • Save caralgar/d9e95681654f1a104665 to your computer and use it in GitHub Desktop.
Save caralgar/d9e95681654f1a104665 to your computer and use it in GitHub Desktop.
Get permalink WPML for any content
<?php
/*
How to get the permalink for any content
- Reference: https://wpml.org/wpml-hook/wpml_element_link/
- More hooks & examples at: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-605226
*/
// apply_filters( 'wpml_element_link', int $element_id, string $element_type, string $link_text, array $optional_parameters, string $anchor, bool $echo, bool $return_original_if_missing )
apply_filters( 'wpml_element_link', 1, 'page');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment