block_core_post_time_to_read_word_count


block_core_post_time_to_read_word_count ( $text, $type )

Parameters:
  • (string) text Text to count elements in.
  • (string) type The type of count. Accepts 'words', 'characters_excluding_spaces', or 'characters_including_spaces'.
Returns:
  • (string) The rendered word count.
Defined at:

Description

Counts words or characters in a provided text string.This function currently employs an array of regular expressions to parse HTML and count words, which may result in inaccurate word counts. However, it is designed primarily to agree with the corresponding JavaScript function. Any improvements in the word counting, for example with the HTML API and {@see} should coordinate with changes to the JavaScript implementation to ensure consistency between the editor and the rendered page.

Related Functions

render_block_core_post_time_to_read, register_block_core_post_time_to_read, block_core_comment_template_render_comments, render_block_core_post_comments_count, register_block_core_post_comments_count

Top Google Results

User discussions

wpseek mobile