I wonder if it exists a "official" way to know if if WMPL is active. Something like is_wpml_active()
Otherwise I would write a script checking if any WPML Class exist.
I'm developing a script that given a post ID would return an array with all ID from its translations.
Maybe is there any WPML function which do this job?
Where can I get a list of available functions.
We develop plugins and themes and many customer request to be compatible with WPML
$post_id = 2; // Here is your ID
$post_type = get_post_type($post_id); // Get the post type
// Get "trid" of the post
$trid = apply_filters( 'wpml_element_trid', NULL, $post_id, 'post_' . $post_type );
// Get the translations
$translations = apply_filters( 'wpml_get_element_translations', NULL, $trid, 'post_' . $post_type);
var_dump($translations);
The topic ‘[Closed] Check if WPML is active’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.