doushuo2834 2013-09-23 20:51
浏览 38

用于wordpress的RTL Tester插件

I used this wordpress plugin to change the website directions from LTR to RTL

the plugin name is: RTL Tester: http://wordpress.org/plugins/rtl-tester/

The main problem is the website admin dashboard is in english and I dont want to change it to Arabic, but when I active the RTL Tester plugin, It will change the website front end pages directions .. (home .. about ... contact) .. and the wp-admin dashboard! and thats what I dont want to change ... I only want to change the website front end and not the back-end!

any one can help me?

  • 写回答

1条回答 默认 最新

  • dtr32787 2013-09-23 21:40
    关注

    Untested, but give it a try:

    <?php
    /* Plugin Name: Admin Fixed RTL */
    
    add_filter( 'get_user_metadata', 'fix_rtl_so_18968615', 10, 4 );
    
    function fix_rtl_so_18968615( $value, $object, $key, $single ) 
    {
        if( !is_admin() )
            return $value;
    
        if( 'rtladminbar' == $key )
            return 'ltr';
    
        return $value;
    }
    

    This will intercept get_user_meta for the key rtladminbar, and if it is not the admin side, it returns the saved value, otherwise make it LTR for all users.

    After clicking on RTL, the admin will change to RTL, but will come back to LTR in the next load.

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?