Suggestion for use with filters
-
When using filters on the post content, wrong reading times can occur. (ie: Reading times of 0 minutes.) I use a system that regulates access to posts, for example, and people will just see a bit of a post, with a reading time of only several seconds.
A solution I’ve come up with is using a new variable for calculating the content, and getting the unfiltered content in there. Example:
At line 46:
$tempo[0] = round(str_word_count(strip_tags($content))*60/$reading_time_options[1]);
and then of course just before the tempo calculation:
$realcontent = get_the_content();
- The topic ‘Suggestion for use with filters’ is closed to new replies.