Saya sedang membangun contoh tema WordPress kustom, yang harus berbahasa Arab di depan umum dan bahasa Inggris di situs Admin, tetapi dengan RTL (flush right) di bidang pengeditan. Tema saya menangani wajah publik, tetapi saya perlu bantuan dengan tema admin.
Saya tahu ada cara untuk membuat blog semuanya berbahasa Arab, tetapi saya ingin semua label admin dan nama kategori tetap berbahasa Inggris. Saya hanya ingin semua kolom entri teks admin menjadi RTL. Oh, dan bidang entri teks yang dihasilkan plugin juga, tapi saya kira itu lebih sulit.
Saya tahu ini adalah perubahan CSS, tetapi tidak yakin harus mulai dari mana dengan sebagian kustomisasi antarmuka.
Pertanyaan bagus. Saya dapat membuat seluruh admin RTL dengan plugin kecil (saya menulisnya sebagai plugin yang harus digunakan , tetapi harus bekerja di dalam standar folder plugin juga). Ini versi yang sangat sederhana, lihat hasilnya di sini:
Ini adalah kode plugin (nama file saya: 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;