Adds shortcodes to the WPML environment, like wpml__, wpml_e and more. Makes WP full WPML ready.
Adds the wpml__ and wpml_e functions to your theme and the wpml__ shortcode to your WordPress website. Make your WordPress full WPML ready!
<?php wpml__( $text, $context ); ?> <?php wpml_e( $text, $context ); ?>
Similarly to the behaviour of the __, _e functions, you must provide a string to make translateable and a context. That’s it; just provide translations from the WPML > String Translations admin panel.
Check how to use the shotcode below.
<h1><php echo wpml__( 'Title', 'wpmlshortcodes' ); ?></h1> <h2><?php wpml_e( 'Subtitle', 'wpmlshortcodes' ); ?></h2>
<h1>[wpml__ context=wpmlshortcodes]Title[/wpml__]</h1> <h2>[wpml__ context=wpmlshortcodes]Subtitle[/wpml__]</h2>
If you wanna contribute, pull requests on github.com.
Simply search for ‘WPML Shortcodes’ in the Plugins Admin page, then install and activate it. That's it!
Developed by Mirco Babini (Web Developer & Mobile App Developer), CEO @ SED Web