RTL/LTR frontend switcher

Ok. I resolved it in this way. Let’s say that we have a CSS-file rtl.css, which contains rules for right-to-left content direction.

Add menu items: Appearance->Menus->Select a menu to edit->Edit menus->Custom links.

  1. URL – ?language=rlt (or something like this), Link text – RTL (for example)
  2. URL – ?language=ltr, Link text – LTR

Create a plugin:

add_action('init', 'get_check');

function get_check(){
    if(!session_id()) {
        session_start();
    }

    if($_GET['language'] == 'rtl'){
        $_SESSION['rtl']=true;
    }

    if($_SESSION['rtl']){
        wp_enqueue_style( 'tmpl_rtl_css', get_template_directory_uri().'/rtl.css',array('tmpl_dir_css') );      
    }

    if($_GET['language'] == 'ltr'){
        session_destroy ();
        wp_dequeue_style('tmpl_rtl_css');
    }
}

There need checking, but solution is something like this.