We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b1854a commit bae4255Copy full SHA for bae4255
src/Resources/functions/functions.php
@@ -120,13 +120,10 @@ function get_most_viewed_posts($args = []): array
120
*/
121
function get_realtime_pageview_count($since = null): int
122
{
123
- if (is_numeric($since) || is_int($since)) {
+ if (is_numeric($since)) {
124
$since = (int) $since;
125
- } elseif (is_string($since)) {
126
- // $since is relative time string
127
- $since = strtotime($since);
128
} else {
129
- $since = strtotime('-5 minutes');
+ $since = strtotime($since ?? '-5 minutes');
130
}
131
132
$counts = (array) get_option('koko_analytics_realtime_pageview_count', []);
0 commit comments