wp_get_word_count_type

The timeline below displays how wordpress function wp_get_word_count_type has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Retrieves the word count type based on the locale.
 *
 * @since 6.2.0
 *
 * @global WP_Locale $wp_locale WordPress date and time locale object.
 *
 * @return string Locale-specific word count type. Possible values are `characters_excluding_spaces`,
 *                `characters_including_spaces`, or `words`. Defaults to `words`.
 */
function wp_get_word_count_type()
{
    global $wp_locale;
    if (!$wp_locale instanceof WP_Locale) {
        // Default value of WP_Locale::get_word_count_type().
        return 'words';
    }
    return $wp_locale->get_word_count_type();
}