Created
February 27, 2018 11:33
-
-
Save alexminza/767deb764b18e0d3f730fe33a93078e1 to your computer and use it in GitHub Desktop.
WordPress translate__ shortcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//https://codex.wordpress.org/Function_Reference/shortcode_atts | |
$args = shortcode_atts( | |
array( | |
'text' => '', | |
'domain' => 'default', | |
), $atts, 'translate__'); | |
//https://developer.wordpress.org/reference/functions/__/ | |
return __($args['text'], $args['domain']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment