• Resolved Luigino

    (@luigino)


    Hello everyone!

    I have this simple php variable $myvariable who I have to pass to .dialog via <?php echo $myvariable ?> but since I have translated the content in a .po file and passing with _e() , how I can pass to $myvariable the result of _e(‘the table is red’, ‘myplugin-slug’); ?

    Precisely I have this:

    $data_complete = (string) "<strong>" . sprintf( _e('Data are updated. Please login with account just registered!','xxxxxxxxxxx') ) . "</strong>";
    	?>
    		<script type="text/javascript">
    			jQuery(document).ready(function ($) {
    				$("#messages_label").text('<?= (string) $data_complete; ?>');
    				$("#messages_box").show();
    				$("#signup_form").trigger('reset');
    			});
    		</script>
    	<?php

    but the text from _e() won’t put inside #messages_label…

    Thanks a lot in advance!
    Cheers!

    • This topic was modified 3 years, 1 month ago by Luigino.
    • This topic was modified 3 years, 1 month ago by Luigino.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to pass _e() to php variable?’ is closed to new replies.