-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to escape string for translation in the string translation panel #83
Conversation
* @return string translation in the current language | ||
*/ | ||
function plll_esc_htlm__ ( $string ) { | ||
return esc_html__( pll__( $string ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing the text domain here. You want to do return esc_html( pll__( $string ) );
.
* @param string $string the string to translate | ||
* @return string translation in the current language | ||
*/ | ||
function plll_esc_htlm__ ( $string ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a "l" too many in plll
and html is spelled incorectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename the function to pll_esc_html__ including in the function where it is used below?
* @param string $string the string to translate | ||
* @return string translation in the current language | ||
*/ | ||
function plll_esc_htlm__ ( $string ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename the function to pll_esc_html__ including in the function where it is used below?
|
Hi! I am ok to introduce these new functions. We could also add the corresponding functions for |
hi @grappler thank you for correction. Also add pll_esc_attr (without _e and ). WordPress it self not having esc_attr or esc_attr_e function. so i think we don't need to have it also. Thank you |
* @param string $string the string to translate | ||
* @return string translation in the current language | ||
*/ | ||
function pll_esc_htlm__ ( $string ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a space between the function name and the opening bracket. HTML has still a typo.
echo pll_esc_htlm__( $string ); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two line breaks instead of one.
I am not sure what you mean. You can see these two function below. |
I renamed |
this commit related to ticket #82