wp_get_word_count_type

函式
wp_get_word_count_type ( No parameters )
返回值
  • (string) Locale-specific word count type. Possible values are `characters_excluding_spaces`, `characters_including_spaces`, or `words`. Defaults to `words`.
定義位置
相關方法
wp_get_environment_typewp_get_document_titlewp_get_ext_typeswp_get_layout_styleget_comment_type
引入
6.2.0
棄用
-

wp_get_word_count_type: 這個函式返回WordPress對文章和頁面使用的字數型別。預設情況下,WordPress使用預設的字數統計型別,它包括內容中的所有字,包括快捷鍵和HTML標籤內的字。然而,這個函式可以用來檢索其他的字數統計型別,比如clean,它不包括短程式碼和HTML標籤裡面的內容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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();
}
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(); }
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();
}

常見問題

FAQs
檢視更多 >