Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created December 18, 2014 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thefuxia/70f4c4a67b4eb40132f3 to your computer and use it in GitHub Desktop.
Save thefuxia/70f4c4a67b4eb40132f3 to your computer and use it in GitHub Desktop.
Get translation from MultilingualPress
<?php
add_action( 'wp_footer', function() {
$mlp_language_api = apply_filters( 'mlp_language_api', NULL );
if ( is_a( $mlp_language_api, 'Mlp_Language_Api_Interface' ) ) {
$args = [
'site_id' => get_current_blog_id(),
'content_id' => get_queried_object_id(),
'type' => 'post',
'strict' => TRUE,
'search_term' => '',
'post_type' => 'page',
'include_base' => TRUE
];
//** @var Mlp_Language_Api_Interface $mlp_language_api
$translations = $mlp_language_api->get_translations( $args );
print '<pre>' . print_r( $translations, 1 ) . '</pre>';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment