
السلام عليكم ورحمة الله
بعد التحديث الأخير للوردبريس 3.8 لاحظت في لوحة الإدارة وبالضبط في محرري القوالب والإضافات تغير اتجاه المحرر حيث صار من اليمين إلى اليسار وفي ذلك صعوبة في التحرير ولحل هذه المشكلة البسيطة :
نحرر ملف :
wp-admin/theme-editor.php
ونبحث عن :
<form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field( 'edit-theme_' . $file . $stylesheet ); ?>
<div ><textarea cols="70" rows="30" name="newcontent" id="newcontent" aria-describedby="newcontent-description"><?php echo $content; ?></textarea>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
<input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
<input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
</div>
ونستبدله بالتالي :
<style type="text/css">
.ltr-editor-t {
direction: ltr;
}
</style>
<form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field( 'edit-theme_' . $file . $stylesheet ); ?>
<div ><textarea cols="70" rows="30" name="newcontent" class="ltr-editor-t" id="newcontent" aria-describedby="newcontent-description"><?php echo $content; ?></textarea>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
<input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
<input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
</div>
ونعمل نفس الشيء مع ملف :
wp-admin/plugin-editor.php
لكن بالنسبة للذي لا يريد التعديل في ملفات الوورد بريس الأصلية هناك حل آخر وهو التعديل على القالب المستعمل فقط وذلك بتحرير ملف functions.php الخاص بالقالب المستعمل ثم وضع الكود التالي :
//benaceur-php.com بداية كود حل مشكلة تغير اتجاه محرر القوالب في لوحة الإدارة
function correctEditor_theme_plugin(){
echo '<style> #template textarea { direction: ltr; } </style>';
}
add_action( 'admin_head-theme-editor.php', 'correctEditor_theme_plugin' );
add_action( 'admin_head-plugin-editor.php', 'correctEditor_theme_plugin' );
//نهاية كود حل مشكلة تغير اتجاه محرر القوالب في لوحة الإدارة
انتهى.
رابط الموضوع للنسخ
ايضا اسم كاتب التعليق داخل لوحة التحكم لايظهر في الايفون
لم أجربه على الأيفون