Last active
December 21, 2017 12:24
-
-
Save sepiariver/8b12917b6cba4a5460e6675f20ac8ac6 to your computer and use it in GitHub Desktop.
Reading time MODX output filter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = (int) $modx->getOption('options', $scriptProperties, 200, true); // 200 words per minute | |
$wordCount = (int) str_word_count(strip_tags($input)); // To display word count set options to 0 | |
if ($options === 0) return $wordCount; | |
return ceil($wordCount / abs($options)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment