WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/is rtl

Contents

Description

Checks if current locale is RTL (Right To Left script).

Usage

<?php is_rtl() ?>

Parameters

This tag does not accept any parameters.

Return Values

(boolean) 
True if current locale is RTL, False on LTR.

Examples

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__) );
}

Notes

  • Deprecate get_bloginfo('text_direction') in favor of is_rtl() in Version 3.0.

Changelog

Source File

is_rtl() is located in wp-includes/locale.php.

Related

See also index of Function Reference and index of Template Tags.