Plugin language always shows WP site language, not profile language

I found the solution: In the constructor I had to add this public function __construct() { // your code goes here add_action( ‘plugins_loaded’, [$this, ‘load_text_domain’] ); // your code goes here } public function load_text_domain() : void { load_plugin_textdomain(‘your-plugin-textdomain’); } This finally made sure that the language displayed followed the settings of the user profile … Read more

Do I need to include a textdomain if my theme doesn’t support translation?

If your code, be it a theme or a plugin, does not support translation, then don’t use the translation functions. And if you don’t use these functions, you cannot use a text domain. 🙂 There is a very common error that looks like this: echo __( ‘Portfolio’ ); Portfolio is not part of WordPress’ core … Read more

Redirect user on first visit based on geographical location

I would say use a $_SESSION[‘var’] var or $_COOKIE[] to check if the link is clicked. Looks like the plugin is calling the geo_redirect_client_location function and then redirecting. function geo_redirect_client_location(){ $geo = new Geo_Redirect(); $geo->checkIfRedirectNeeded(); } I’m not familiar enough with the plugin but I would so something like: <a href=”https://wordpress.stackexchange.com/questions/89111/example-intenational-sitelink.com/?show_intl=true”>Link on US site to … Read more

Localize URL bases

This should cover everything: function wpa_rewite_translate(){ global $wp_rewrite; $wp_rewrite->pagination_base=”pagina”; $wp_rewrite->author_base=”autor”; $wp_rewrite->comments_base=”comentarios”; $wp_rewrite->feed_base=”alimentar”; $wp_rewrite->search_base=”busqueda”; $wp_rewrite->set_category_base( ‘categoria/’ ); $wp_rewrite->set_tag_base( ‘etiqueta/’ ); } add_action( ‘init’, ‘wpa_rewite_translate’ ); Feel free to laugh at my translations, haha. Also, to flush rewrite rules when your theme is activated, add this: function wpa_flush_rewite(){ flush_rewrite_rules(); } add_action( ‘after_switch_theme’, ‘wpa_flush_rewite’ );

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