
使用XAMPP本地搭建WordPress网站图文教程
wp_get_word_count_type ( No parameters )
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(); }