Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wpml get translated post id

// WPML get Post on translated Language
// The only parameter you have to use is -> $postIdToTranslate
// 'POST_TYPE_NAME' can be: post, page, or your custom post type name
// ICL_LANGUAGE_CODE can be 'en','es', etc.
$translatedPostId = icl_object_id($postIdToTranslate, 'POST_TYPE_NAME', false, ICL_LANGUAGE_CODE);
$myPost = get_post( $translatedPostId );
Comment

PREVIOUS NEXT
Code Example
Php :: how to count string characters in php 
Php :: laravel check if in production 
Php :: laravel env pgsql 
Php :: php echo json 
Php :: background image in laravel blade 
Php :: throwexception laravel 
Php :: php directory exists 
Php :: php get user ip 
Php :: guzzle bearer token 
Php :: php string to array 
Php :: get parent page link wordpress 
Php :: foreach empty laravel 
Php :: v0.8.1 requires ext-curl * - the requested PHP extension curl is missing from your system. 
Php :: php date loop 
Php :: pasar datetime a string php 
Php :: is number divisible by 3 php 
Php :: laravel create project in current directory 
Php :: php delete array item by value 
Php :: lravel redirect with error 
Php :: php max_execution_time 
Php :: how to check if username already exists in php 
Php :: form post self php 
Php :: tax query by term id 
Php :: wordpress execute query 
Php :: woocommerce-cart-count 
Php :: change background color php 
Php :: wordpress errors 
Php :: get all pages list from specific template 
Php :: laravel generate slug 
Php :: for install perticular version in vue with laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =