1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

readingtime: remove temporary error_log lines

This commit is contained in:
Starbeamrainbowlabs 2020-05-25 00:25:02 +01:00
parent d9024cbe59
commit 725611ace4
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -9,17 +9,14 @@ register_module([
page_renderer::register_part_preprocessor(function(&$parts) {
global $env, $settings;;
error_log("[readingtime] part_preprocessor, matching $settings->readingtime_action");
// Only insert for the view action
if($env->action !== $settings->readingtime_action || !$settings->readingtime_enabled)
return;
error_log("[readingtime] go ahead");
$reading_time = estimate_reading_time(
file_get_contents($env->page_filename),
$settings->readingtime_language
);
error_log(var_export($reading_time, true));
$insert = "<small><em>{$reading_time[0]} - {$reading_time[1]} minute read</em></small>";
if($reading_time[0] === $reading_time[1])