esc_html__() and __() not working within arrays

I created simple widget to find out why you have such a problem. Everything is working fine. Below I give you my code as an example. /** * Register widget */ function wpse_287570_register_widget() { register_widget(‘WPSE_287570_Widget’); } add_action(‘widgets_init’, ‘wpse_287570_register_widget’); /** * Create widget */ class WPSE_287570_Widget extends WP_Widget { public function __construct() { $op = array( … Read more

Translation from .mo file not working in theme

Start a new theme from scratch to see if you have the same result. I test with theses files and the translation works style.css /* Theme Name: My Theme */ functions.php <?php add_action( ‘after_setup_theme’, ‘my_theme_load_theme_textdomain’ ); function my_theme_load_theme_textdomain() { load_theme_textdomain( ‘my-theme’, get_template_directory() . ‘/languages’ ); } languages/es_ES.po (file languages/es_ES.mo created with poedit) msgid “Featured” msgstr … Read more

Using _e() or __() to translate text with div

None of them are correct. These APIs are not intended for dynamic data or content in the database. This would be the best practice answer: echo ‘<h2 class=”title”>’; esc_html_e( ‘static string’, ‘text-domain’ ); echo ‘</h2>’; If you want to translate posts and other database user entered content, use a translation plugin, not the localisation API. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)