-
-
Save Burick/3b7c98823de11f7b7e9c8fd3d64385a2 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