“Function Reference/get locale”的版本间的差异

来自WordPress中文文档
跳转至: 导航搜索
(.64.)
 
(1个修订)
(没有差异)

2009年3月14日 (六) 09:23的版本

Description

Gets the current locale.

If the locale is set, then it will filter the locale in the 'ttlocale/tt' filter hook and return the value.

If the locale is not set already, then the WPLANG constant is used if it is defined. Then it is filtered through the 'ttlocale/tt' filter hook and the value for the locale global set and the locale is returned.

The process to get the locale should only be done once but the locale will always be filtered using the 'ttlocale/tt' hook.

Usage

%%%?php get_locale() ?%%%

Parameters

None.

Return Values

(string) 
The locale of the blog or from the 'ttlocale/tt' hook.

Examples

!-- Need creative examples. Feel free to link to external examples. --

Notes

  • Uses: ttapply_filters()/tt Calls 'ttlocale/tt' hook on locale value.
  • Uses: tt$locale/tt Gets the locale stored in the global.
  • Uses global: (ttunknown/tt) tt$locale/tt
  • il10n/i is an abbreviation for ilocalization/i.

Change Log

Since: 1.5.0

Source File

!-- Need links to current source code files -- ttget_locale()/tt is located in ttwp-includes/l10n.php/tt.

Related

!--

   To Do:
   Need to find related functions.
   Need to create groups of functions and create templates to add them to a page quickly.
   Some functions may be related to many groups of functions.

--