WP_Locale::get_word_count_type
Retrieves the localized word count type.
Метод класса: WP_Locale{}
Хуков нет.
Возвращает
string. Localized word count type. Possible values are characters_excluding_spaces, characters_including_spaces, or words.
Использование
global $wp_locale; $wp_locale->get_word_count_type();
Список изменений
| С версии 6.2.0 | Введена. |
Код WP_Locale::get_word_count_type() WP Locale::get word count type WP 7.1.3
public function get_word_count_type() {
/*
* translators: If your word count is based on single characters (e.g. East Asian characters),
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
* Do not translate into your own language.
*/
$word_count_type = $this->word_count_type ?? _x( 'words', 'Word count type. Do not translate!' );
// Check for valid types.
if ( 'characters_excluding_spaces' !== $word_count_type && 'characters_including_spaces' !== $word_count_type ) {
// Defaults to 'words'.
$word_count_type = 'words';
}
return $word_count_type;
}