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标签里面的内容。

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
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 14:32:54

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: