is_rtl() - WordPress 函数参考中文文档

返回介绍

is_rtl()

发布于 2017-09-11 字数 3023 浏览 837 评论 0

is_rtl()

Checks if current locale is RTL.


描述


返回值

(bool) Whether locale is RTL.


源代码

File: wp-includes/l10n.php

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

更新日志

Version 描述
3.0.0 Introduced.

相关函数

Uses

  • wp-includes/class-wp-locale.php:
    WP_Locale::is_rtl()

Used By

  • wp-includes/customize/class-wp-customize-site-icon-control.php:
    WP_Customize_Site_Icon_Control::content_template()
  • wp-includes/general-template.php:
    get_language_attributes()
  • wp-admin/includes/class-wp-press-this.php:
    WP_Press_This::html()
  • wp-admin/includes/class-wp-press-this.php:
    WP_Press_This::add_editor_style()
  • wp-login.php:
    login_header()
  • wp-admin/install.php:
    display_header()
  • wp-admin/includes/template.php:
    iframe_header()
  • wp-admin/includes/media.php:
    wp_iframe()
  • wp-includes/theme.php:
    add_editor_style()
  • wp-includes/general-template.php:
    register_admin_color_schemes()
  • wp-includes/general-template.php:
    wp_admin_css()
  • wp-includes/general-template.php:
    get_bloginfo()
  • wp-includes/load.php:
    wp_maintenance()
  • wp-includes/functions.php:
    _mce_set_direction()
  • wp-includes/functions.php:
    dead_db()
  • wp-includes/functions.php:
    _default_wp_die_handler()
  • wp-includes/post-template.php:
    get_body_class()
  • wp-includes/media.php:
    gallery_shortcode()
  • wp-includes/script-loader.php:
    wp_default_styles()
  • wp-includes/class-wp-editor.php:
    _WP_Editors::wp_mce_translation()
  • wp-includes/media-template.php:
    wp_print_media_templates()
  • Show 16 more used by
    Hide more used by


User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Basic Example

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

上一篇:is_robots()

下一篇:is_search()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!