WP_Locale::get_word_count_type(): string

Retrieves the localized word count type.


string Localized word count type. Possible values are characters_excluding_spaces, characters_including_spaces, or words. Defaults to words.

Top ↑


File: wp-includes/class-wp-locale.php. View all references

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 = is_null( $this->word_count_type ) ? _x( 'words', 'Word count type. Do not translate!' ) : $this->word_count_type;

	// 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;

Top ↑


Version Description
6.2.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.