pll_get_post_translations
Returns an array of translations of a post.
Description
(array) pll_get_post_translations( (int) $post_id );
Returns (array)
an associative array of translations with language code as key and translation post_id as value
Parameters (1)
- 0. $post_id (int)
- The post id.
Usage
if ( !function_exists( 'pll_get_post_translations' ) ) { require_once ABSPATH . PLUGINDIR . 'polylang/include/api.php'; } // The post id. $post_id = -1; // NOTICE! Understand what this does before running. $result = pll_get_post_translations($post_id);
Defined (1)
The function is defined in the following location(s).
- /include/api.php
- function pll_get_post_translations( $post_id ) {
- return PLL()->model->post->get_translations( $post_id );
- }