Açıklama
EffortLess Multisite Language Switcher is a lightweight plugin designed for WordPress Multisite networks.
It adds a floating globe icon on the frontend, allowing users to quickly switch between subsites — each typically representing a different language or locale.
The plugin detects each site’s locale setting and displays an appropriate flag icon. Flags are automatically mapped using a JSON file and preloaded to enhance performance. Optimized caching ensures fast rendering of the switcher.
This plugin is ideal for multilingual networks using subdirectories or subdomains.
Features:
– Automatically detects and displays flags for each site in the network.
– Uses a floating, always-visible globe icon for an intuitive language switcher.
– Intelligently switches to equivalent pages/posts with matching slugs across language sites.
– Falls back to site homepage if equivalent page doesn’t exist on target site.
– Option to hide the language switcher on all sites via network admin settings.
– Customizable switcher position (top-left, top-right, bottom-left, bottom-right) with adjusted top spacing.
– Flag menu appears below the switcher for top positions and above for bottom positions.
– Smart caching using WordPress transients for flag mappings and site lists.
– Fully compatible with subdirectory and subdomain multisite setups.
– Optimized for performance with minimal resource usage.
License
This plugin is released under the GPLv2 or later.
You can use it freely in commercial or personal projects.
Donate
If you enjoy using this plugin, please consider supporting its development:
Yükleme
- Upload the plugin folder to the
/wp-content/plugins/directory. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- Ensure each subsite in your network has the proper
WPLANGsetting (via Settings > General). - Create pages/posts with matching slugs across language sites for automatic URL matching.
- (Optional) Customize translations and flag mappings in
/assets/flags/andlocales_flags.json. - (Optional) Use the network admin settings to hide specific sites, hide the entire language switcher, or adjust its position.
SSS
-
Does this plugin work on single-site WordPress installations?
-
No. This plugin is designed exclusively for WordPress Multisite networks.
-
How does it detect the language for each subsite?
-
It uses the
WPLANGsetting from each site’s options. -
How does the plugin match pages across different language sites?
-
The plugin looks for pages/posts with the same slug (post name) on the target language site. For example, if you’re viewing
/en/about-us/and switch to French, it will try to load/fr/about-us/. If that page doesn’t exist, it falls back to the homepage of the French site. -
Do I need to manually link pages together?
-
No! As long as your pages/posts have the same slug across different language sites, the plugin will automatically find and link to them.
-
Can I customize the flags or locales?
-
Yes! Edit the
assets/flags/locales_flags.jsonfile to add or modify mappings. -
Are the flags hosted locally?
-
Yes, all flag icons are SVG files stored in the plugin’s
/assets/flags/1x1/directory. -
Can I hide the language switcher completely?
-
Yes, you can disable the language switcher for all sites using the option in the network admin settings.
-
Can I change the position of the language switcher?
-
Yes, you can select from top-left, top-right, bottom-left, or bottom-right positions in the network admin settings, with top positions adjusted for better spacing.
-
What happens if a page doesn’t exist in the target language?
-
The plugin will automatically redirect to the homepage of the target language site.
İncelemeler
Katkıda Bulunanlar ve Geliştiriciler
“EffortLess Multisite Language Switcher” açık kaynaklı yazılımdır. Aşağıdaki kişiler bu eklentiye katkıda bulunmuşlardır.
Katkıda bulunanlar“EffortLess Multisite Language Switcher” eklentisini dilinize çevirin.
Geliştirmeyle ilgilenir misiniz?
Kodu görüntüleyin, SVN deposuna göz atın ya da RSS ile geliştirme günlüğüne abone olun.
Değişiklik Kaydı
1.0.26
- Fixed Latvia flag not showing
1.0.25
- Fixed JavaScript click handling to allow natural link navigation.
- Removed unnecessary event handlers that were preventing flag clicks.
- Improved outside-click detection for better menu behavior.
- Enhanced cache-busting with version update.
1.0.24
- Added intelligent page/post matching across language sites by slug.
- Plugin now automatically switches to equivalent pages with matching slugs on target sites.
- Falls back to site homepage if equivalent page doesn’t exist.
- Improved URL handling for better cross-site navigation.
- Enhanced user experience with seamless language switching on specific pages.
1.0.23
- Refined CSS integration to ensure flag menu appears below the switcher for top positions and above for bottom positions, aligning with style.css.
1.0.22
- Improved CSS for flag menu positioning with explicit z-index and spacing; fixed JavaScript typo in timeout clearing.
1.0.21
- Updated JavaScript to ensure flag menu positioning compatibility (below for top positions, above for bottom positions).
1.0.20
- Flag menu now appears below the language switcher for top positions and above for bottom positions.
1.0.19
- Adjusted top positioning of language switcher (top-left, top-right) to be further from the top edge for better spacing.
1.0.18
- Added option to select language switcher position (top-left, top-right, bottom-left, bottom-right) via network admin settings.
1.0.17
- Added option to hide the language switcher on all sites via network admin settings.
1.0.16
- Settings only available on multisite admin dashboard.
1.0.15
- Added checkbox to choose visible languages.
1.0.14
- Fixed PHPCS errors: Renamed file to class-elmls-plugin.php, added @package tag.
- Conditionalized error_log calls to reduce debug log clutter.
- Justified file_get_contents for local file usage.
1.0.13
- Fixed PHPCS errors: Added docblocks, renamed file to class-elmls-plugin.php, removed short ternaries, and conditionalized debug logs.
- Improved code compliance with WordPress coding standards.
- Optimized flag rendering with explicit logic.
1.0.12
- Optimized performance: Added transient caching for flag URLs and site queries.
- Improved flag rendering speed by simplifying image handling.
- Fixed debug log clutter by conditionalizing error_log calls with WP_DEBUG.
- Enhanced JavaScript for faster UI initialization.
1.0.11
- Fixed issue showing duplicate flags.
0.3.0
- Initial public release.
- Added JSON-based flag mapping.
- Implemented transient caching for site listing.
- Included floating icon rendering logic.
