New answers tagged translation
There are multiple ways to do this: 1. Add multiple columns to the table with the strings you have to localize. E.g. one column for German, one for English, and so on. And then get the string from the appropriate column. This is perfect if the number of languages stays more or less constant (you have to change the DB for every new language). 2. Add a ...
You are doing it wrong You should translate the HTML string, not the function When passing strings into functions, like what you are doing, you should use __() which returns the translated string. _e() would echo the string and you would get the raw text and the modified text on output Example of correct usage: get_next_posts_link( __( 'Older posts' ), ...
For some reason, strtotime didn't recognise the date format d.m.y. m/d-y is save. Then it worked.
The security risk here is not about the plain text but about translation. You should note that esc_html_e is not only a function for escaping HTML but also for localization (l10n). I.e. other people can translate this String but you don't know what the translation would be. It is possible that somebody translates the String and adds a link or some malicious ...
You can do it with printf(). E.g. printf( __( 'We deleted %d spam messages.', 'my-text-domain' ), $count );
Top 50 recent answers are included