Skip to content
No results
  • Plugins
  • Blog
  • Support
    • Forum
    • Create Support Ticket
    • Documentations
    • Affiliates
    • Join Facebook Group
  • Account
    • License keys
    • Cart
    • Checkout
    • Orders
    • Downloads
  • Search
  • FluentCart Product Slider
PickPlugins logo
  • Plugins
  • Blog
  • Support
    • Forum
    • Create Support Ticket
    • Documentations
    • Affiliates
    • Join Facebook Group
  • Account
    • License keys
    • Cart
    • Checkout
    • Orders
    • Downloads
  • Search
  • FluentCart Product Slider
PickPlugins logo

Language Switcher for Polylang customization ?

  • PickPluginsPickPlugins
  • March 24, 2017
  • FAQ – User Profile

If you are using Polylang plugin to support multi language on your site, you will need to user profile switch to user id and nav. please add following code to support navigate user.

include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
 
// check if polylang exist & enabled
if ( is_plugin_active( 'polylang/polylang.php' ) ) {
    //plugin is activated

    add_filter('pll_the_languages', 'my_dropdown', 10, 2);
    
    function my_dropdown($output, $args) {
        
        if(!empty($_GET['id'])){
            
            $id = $_GET['id'];
            
            }
        else{
            $id = '';
            }
            
        if(!empty($_GET['nav'])){
            
            $nav = $_GET['nav'];
            
            }
        else{
            $nav = '';
            }            
            
        
        
        $translations = pll_the_languages(array('raw'=>1));
        $output = '';
        $output .= '<div class="btn-group" role="group">

    <ul class="dropdown-menu">';
 
        foreach ($translations as $key => $value) {
            $output .= '<li><a href="'.$value['url'].'?id='.$id.'&nav='.$nav.'"><img src="'.$value['flag'].'" alt="'.$value['slug'].'"> ' .$value['name'].'</a></li>';
        }
 
        $output .= '</ul></div>';
        return $output;
    }
}

 

You can't upload any files or attachments to our server directly for security reasons, you can use 3rd party website and share the file URL here. here is the top file-sharing website you can use.
dropbox.com
mediafire.com
drive.google.com
onedrive.live.com

Copyright © 2026 by PickPlugins