is_rtl() WordPress Function

The is_rtl() function in WordPress is used to check if the current text direction is right-to-left. This function is useful for making sure that your content is displayed correctly for users who are using a right-to-left language.

is_rtl() #

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


Description

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.


Top ↑

Return

(bool) Whether locale is RTL.


Top ↑

More Information

Deprecate get_bloginfo(‘text_direction’) in favor of is_rtl() in Version 3.0.


Top ↑

Source

File: wp-includes/l10n.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.