Title: is_rtl
Published: April 25, 2014
Last modified: August 20, 2026

---

# is_rtl(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#wp--skip-link--target)

Determines whether the current locale is right-to-left (RTL).

## 󠀁[Description](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#description)󠁿

For more information on this and similar theme functions, check out the [ Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/)
article in the Theme Developer Handbook.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#return)󠁿

 bool Whether locale is RTL.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#more-information)󠁿

Deprecate get_bloginfo(‘text_direction’) in favor of [is_rtl()](https://developer.wordpress.org/reference/functions/is_rtl/)
in [Version 3.0](https://wordpress.org/support/wordpress-version/version-3-0/).

## 󠀁[Source](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#source)󠁿

    ```php
    function is_rtl() {
    	global $wp_locale;
    	if ( ! ( $wp_locale instanceof WP_Locale ) ) {
    		return false;
    	}
    	return $wp_locale->is_rtl();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/l10n.php#L1881)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/l10n.php#L1881-L1887)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Locale::is_rtl()](https://developer.wordpress.org/reference/classes/wp_locale/is_rtl/)`wp-includes/class-wp-locale.php` |

Checks if current locale is RTL.

  |

| Used by | Description | 
| [wp_enqueue_block_style()](https://developer.wordpress.org/reference/functions/wp_enqueue_block_style/)`wp-includes/script-loader.php` |

Enqueues a stylesheet for a specific block.

  | 
| [get_default_block_editor_settings()](https://developer.wordpress.org/reference/functions/get_default_block_editor_settings/)`wp-includes/block-editor.php` |

Returns the default block editor settings.

  | 
| [register_block_style_handle()](https://developer.wordpress.org/reference/functions/register_block_style_handle/)`wp-includes/blocks.php` |

Finds a style handle for the block metadata field.

  | 
| [WP_Sitemaps_Stylesheet::get_stylesheet_css()](https://developer.wordpress.org/reference/classes/wp_sitemaps_stylesheet/get_stylesheet_css/)`wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php` |

Gets the CSS to be included in sitemap XSL stylesheets.

  | 
| [_wp_die_process_input()](https://developer.wordpress.org/reference/functions/_wp_die_process_input/)`wp-includes/functions.php` |

Processes arguments passed to [wp_die()](https://developer.wordpress.org/reference/functions/wp_die/) consistently for its handlers.

  | 
| [_WP_Editors::print_default_editor_scripts()](https://developer.wordpress.org/reference/classes/_wp_editors/print_default_editor_scripts/)`wp-includes/class-wp-editor.php` |

Print (output) all editor scripts and default settings.

  | 
| [get_language_attributes()](https://developer.wordpress.org/reference/functions/get_language_attributes/)`wp-includes/general-template.php` |

Gets the language attributes for the ‘html’ tag.

  | 
| [login_header()](https://developer.wordpress.org/reference/functions/login_header/)`wp-login.php` |

Outputs the login page header.

  | 
| [display_header()](https://developer.wordpress.org/reference/functions/display_header/)`wp-admin/install.php` |

Display installation header.

  | 
| [iframe_header()](https://developer.wordpress.org/reference/functions/iframe_header/)`wp-admin/includes/template.php` |

Generic Iframe header for use with Thickbox.

  | 
| [wp_iframe()](https://developer.wordpress.org/reference/functions/wp_iframe/)`wp-admin/includes/media.php` |

Outputs the iframe to display the media upload page.

  | 
| [add_editor_style()](https://developer.wordpress.org/reference/functions/add_editor_style/)`wp-includes/theme.php` |

Adds callback for custom TinyMCE editor stylesheets.

  | 
| [register_admin_color_schemes()](https://developer.wordpress.org/reference/functions/register_admin_color_schemes/)`wp-includes/general-template.php` |

Registers the default admin color schemes.

  | 
| [wp_admin_css()](https://developer.wordpress.org/reference/functions/wp_admin_css/)`wp-includes/general-template.php` |

Enqueues or directly prints a stylesheet link to the specified CSS file.

  | 
| [get_bloginfo()](https://developer.wordpress.org/reference/functions/get_bloginfo/)`wp-includes/general-template.php` |

Retrieves information about the current site.

  | 
| [wp_login_form()](https://developer.wordpress.org/reference/functions/wp_login_form/)`wp-includes/general-template.php` |

Provides a simple login form for use anywhere within WordPress.

  | 
| [_mce_set_direction()](https://developer.wordpress.org/reference/functions/_mce_set_direction/)`wp-includes/functions.php` |

Sets the localized direction for MCE plugin.

  | 
| [get_body_class()](https://developer.wordpress.org/reference/functions/get_body_class/)`wp-includes/post-template.php` |

Retrieves an array of the class names for the body element.

  | 
| [gallery_shortcode()](https://developer.wordpress.org/reference/functions/gallery_shortcode/)`wp-includes/media.php` |

Builds the Gallery shortcode output.

  | 
| [wp_default_styles()](https://developer.wordpress.org/reference/functions/wp_default_styles/)`wp-includes/script-loader.php` |

Assigns default styles to $styles object.

  | 
| [_WP_Editors::wp_mce_translation()](https://developer.wordpress.org/reference/classes/_wp_editors/wp_mce_translation/)`wp-includes/class-wp-editor.php` |

Translates the default TinyMCE strings and returns them as JSON encoded object ready to be loaded with tinymce.addI18n(), or as JS snippet that should run after tinymce.js is loaded.

  |

[Show 16 more](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#comment-content-1281)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/is_rtl/#comment-1281)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%23comment-1281)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%23comment-1281)
 4.  **Basic Example**
 5.      ```php
         if ( is_rtl() ) {
           wp_enqueue_style(  'style-rtl',  plugins_url( '/css/style-rtl.css', __FILE__ ) );
           wp_enqueue_script( 'script-rtl', plugins_url( '/js/script-rtl.js',  __FILE__ ) );
         }
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%3Freplytocom%3D1281%23feedback-editor-1281)
 7.   [Skip to note 4 content](https://developer.wordpress.org/reference/functions/is_rtl/?output_format=md#comment-content-7419)
 8.    [Ben Keith](https://profiles.wordpress.org/benlk/)  [  11 months ago  ](https://developer.wordpress.org/reference/functions/is_rtl/#comment-7419)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%23comment-7419)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%23comment-7419)
 10. The language tag `dir="rtl"` is rendered by the function [get_language_attributes()](https://developer.wordpress.org/reference/functions/get_language_attributes/),
     which uses `is_rtl()`.
 11.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F%3Freplytocom%3D7419%23feedback-editor-7419)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_rtl%2F)
before being able to contribute a note or feedback.