“Function Reference/get locale”的版本间的差异
2009年3月14日 (六) 09:23的版本
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.
%%%?php get_locale() ?%%%
- The locale of the blog or from the 'ttlocale/tt' hook.
!-- Need creative examples. Feel free to link to external examples. --
- 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.
!-- Need links to current source code files -- ttget_locale()/tt is located in ttwp-includes/l10n.php/tt.
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.