web-dev-qa-db-fra.com

Configuration d'une interface d'administration partielle de droite à gauche

Je construis une instance de thème WordPress personnalisée, qui doit être en arabe sur la face publique et en anglais sur le site Admin, mais avec RTL (affleurement à droite) dans les champs de modification. Mon thème prend en charge le visage du public, mais j'ai besoin d'aide pour thématiser le côté administrateur.

Je sais qu'il existe un moyen de rendre le blog entièrement en arabe, mais je voulais que toutes les étiquettes et noms de catégories d'administrateurs restent en anglais. Je veux seulement que tous les champs de saisie de texte administrateur deviennent RTL. Oh, et les champs de saisie de texte générés par les plugins aussi, mais je soupçonne que c'est plus difficile.

Je sais que c'est un changement de CSS, mais je ne sais pas par où commencer avec une telle personnalisation partielle de l'interface.

3

Bonne question. J'ai été capable de faire toute la RTL d'administration avec un petit plugin (je l'ai écrit en tant que un plugin à utiliser absolument , mais cela devrait fonctionner dans le standard dossier du plugin aussi bien). C'est une version très simple, voyez le résultat ici:

RTL Admin v0.1 screen output

C'est le code du plugin (mon nom de fichier: rtl-admin.php):

<?php
/**
 * RTL Admin Wordpress Plugin
 *
 * @-wp-header Plugin Name: RTL Admin
 * @-wp-header Author: hakre
 * @-wp-header Version: 0.1
 * @-wp-header Author URI: http://hakre.wordpress.com/
 *
 * @author hakre <hakre.wordpress.com>
 * 
 * Copyright 2010  hakre <hakre.wordpress.com>
 *  
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

class RTLAdminPlugin {
 private static $instance;
 public static function bootstrap() {
  defined('WP_ADMIN') && WP_ADMIN 
  && (self::$instance === null) 
  && (self::$instance = new RTLAdminPlugin());
 }
 public function __construct() {
  $r = add_filter('admin_init', array($this, 'admin_init'));
 }
 public function admin_init() {
  $GLOBALS['wp_locale']->text_direction = rtl;
 }
} // class

RTLAdminPlugin::bootstrap();

return;
#EOF;
2
hakre