Codex Article on Writing a Message in RTL Recommends Using the WP-RTL Plugin
[...] allows you to use the functionality of text indications that already exist in the original TinyMCE editor, which allow you to write texts from left to right and right to left in the same message (or page) for languages ββsuch as Arabic, Persian and Hebrew.
His code is dead simply:
<?php add_action( "init", "tinymce_bidi_addbuttons" ); function tinymce_bidi_addbuttons() { if( !current_user_can ( 'edit_posts' ) && !current_user_can ( 'edit_pages' ) ) { return; } if( get_user_option ( 'rich_editing' ) == 'true' ) { add_filter( "mce_external_plugins", "tinymce_bidi_plugin" ); add_filter( "mce_buttons", "tinymce_bidi_buttons" ); } } function tinymce_bidi_buttons($buttons) { array_push($buttons, "separator", "ltr", "rtl"); return $buttons; } function tinymce_bidi_plugin($plugin_array) { if (get_bloginfo('version') < 3.9) { $plugin_array['directionality'] = includes_url('js/tinymce/plugins/directionality/editor_plugin.js'); } else { $plugin_array['directionality'] = includes_url('js/tinymce/plugins/directionality/plugin.min.js'); } return $plugin_array; }
And here is what he does:

source share