Introduce is_rtl(). Use it in core. It only becomes defined when locale is loaded, so it's impossible to use it too early. Deprecate the get_bloginfo('text_direction') call. fixes #13206.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin
2010-05-03 05:49:19 +00:00
parent 2764e19bc5
commit 4d7c88f4a4
9 changed files with 34 additions and 21 deletions

View File

@@ -2605,8 +2605,6 @@ function wp_die( $message, $title = '', $args = array() ) {
* @param string|array $args Optional arguements to control behaviour.
*/
function _default_wp_die_handler( $message, $title = '', $args = array() ) {
global $wp_locale;
$defaults = array( 'response' => 500 );
$r = wp_parse_args($args, $defaults);
@@ -2661,7 +2659,7 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
$text_direction = 'ltr';
if ( isset($r['text_direction']) && 'rtl' == $r['text_direction'] )
$text_direction = 'rtl';
elseif ( isset($wp_locale ) && 'rtl' == $wp_locale->text_direction )
elseif ( function_exists( 'is_rtl' ) && is_rtl() )
$text_direction = 'rtl';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -2743,9 +2741,7 @@ function _config_wp_siteurl( $url = '' ) {
* @return array Direction set for 'rtl', if needed by locale.
*/
function _mce_set_direction( $input ) {
global $wp_locale;
if ( 'rtl' == $wp_locale->text_direction ) {
if ( is_rtl() ) {
$input['directionality'] = 'rtl';
$input['plugins'] .= ',directionality';
$input['theme_advanced_buttons1'] .= ',ltr';