Dennis Ploetner
Forum Replies Created
-
Forum: Plugins
In reply to: [Multisite Language Switcher] Wrong links for Archive pages and Custom SlugsThanks a lot!
Forum: Plugins
In reply to: [Multisite Language Switcher] Hreflang Missing Return LinksI’m not sure that I get the problem correctly. The code generated by MSLS in the HTML header is wrong or incomplete? Any suggestions how I can/should improve the output?
Forum: Plugins
In reply to: [Multisite Language Switcher] Languages invisble on main siteIt should also show admins. The filter
msls_get_userscan be used to change the user-query: https://msls.co/developer-docs/hook-reference/Forum: Plugins
In reply to: [Multisite Language Switcher] Too much escapingI believe that this issue should be solved with the last version. Thanks for pointing it out!
Forum: Plugins
In reply to: [Multisite Language Switcher] Wrong links for Archive pages and Custom SlugsHey, let’s have proper issue tracking on GitHub: https://github.com/lloc/Multisite-Language-Switcher
I will clean there a bit up in the next days, but the plan is, to use the infrastructure there to manage the requests that will lead to code changes even better.Forum: Reviews
In reply to: [Multisite Language Switcher] Such a useful plugin, and top-rate supportThank you! 🙂
Forum: Plugins
In reply to: [Multisite Language Switcher] Incorrect class for Welsh flagI see. I will, right away, correct it and send a new version online. Thanks!
Happy, you like it! 🙂
Forum: Plugins
In reply to: [Multisite Language Switcher] Wrong links for Archive pages and Custom SlugsI will check this again, but there is also a workaround for cases where the switcher just fails. There is a hook named
msls_options_get_permalink. Read on here: https://msls.co/developer-docs/hook-reference/Forum: Plugins
In reply to: [Multisite Language Switcher] Incorrect class for Welsh flagHey, thanks for your message. I just looked the language code up, and it seems that
cywould be the correct code for Welsh: https://translate.ww.wp.xz.cn/locale/cy/Is your language code somehow set to
gb_WLS? The flags.php file is autogenerated. It uses input from the core and applies the exceptions from one of my build scripts.Thanks for pointing this out. I will look into this and try to reproduce it. In the meanwhile, you could use the labels instead of flags in the WordPress admin, which might be more accurate.
Forum: Plugins
In reply to: [Multisite Language Switcher] Href Lang Tag issueThe title might not be needed, but is an excepted attribute: https://www.w3schools.com/tags/tag_link.asp
You could use the ‘mlsl_output_get_alternate_links_arr’ to clean it, but I don’t think it is worth it. You may make a feature request, if you still believe, that an additional filter is needed: https://github.com/lloc/Multisite-Language-Switcher/issues
Forum: Plugins
In reply to: [Multisite Language Switcher] Href Lang Tag issueI gave you an example of a rewrite of your function. What you really want to archive is probably something like this:
add_filter( 'msls_head_hreflang', function ( $language ) {
return str_replace( '_', '-', $language );
} );The plugin itself applies the following logic though: If the language code contains the region, but the language is exclusive (like German in your example) then the country code will be removed because it is redundant.
Forum: Plugins
In reply to: [Multisite Language Switcher] Href Lang Tag issueThis function here probably does the same as your example:
add_filter( 'msls_head_hreflang', function ( $language ) {
$map = array(
'en_US' => 'en_us',
'en-gb' => 'en',
'es-es' => 'es',
'fr' => 'x-default',
);
return $map[ $language ] ?? $language;
} );In the same function exists another filter called “mlsl_output_get_alternate_links_arr” which expects the array with the generated links as input:
add_filter( 'mlsl_output_get_alternate_links_arr', function ( $links ) {
// do something with the array of links
return $links;
} );- This reply was modified 1 year, 8 months ago by Dennis Ploetner.
Forum: Plugins
In reply to: [Multisite Language Switcher] Site language –> Available languages emptyGlad I could help! Have fun with the Multisite Language Switcher. 🙂