samedi 27 décembre 2014

How to use esc_attr__ with custom translation function?


I just made a built-in translation function to help users to translate their theme from theme options.


Usually my functions works great as follow:



<?php _e( 'No Comments', 'mytextdomain' ); ?>


becomes:



<?php echo __myfunction( 'no_comments' ); ?>


My question is related to esc_attr__ and I'm stuck here... How the following code should look using custom translation function?



esc_attr__( 'No Comments', 'mytextdomain' )


Where should I place my translation function __myfunction ? Will be corect the following code?



esc_attr__myfunction( 'no_comments' )


Thanks





Aucun commentaire:

Enregistrer un commentaire