use time() instead of current_datetime() for WP 4.x compatibility (#6)

The function current_datetime() has been introduced in WP 5.3, but
the Plugin should maintain compatibility with 4.x for now.
This commit is contained in:
Stefan Kalscheuer 2020-04-28 17:36:57 +02:00
parent cf65d6d7c3
commit 4a1197af28

View File

@ -206,7 +206,7 @@ class SCLiveticker {
$output .= ' sclt-ajax" ' $output .= ' sclt-ajax" '
. 'data-sclt-ticker="' . $ticker . '" ' . 'data-sclt-ticker="' . $ticker . '" '
. 'data-sclt-limit="' . $limit . '" ' . 'data-sclt-limit="' . $limit . '" '
. 'data-sclt-last="' . current_datetime()->getTimestamp(); . 'data-sclt-last="' . time();
} }
$output .= '"><ul>'; $output .= '"><ul>';
@ -362,13 +362,13 @@ class SCLiveticker {
$res[] = array( $res[] = array(
'w' => $slug, 'w' => $slug,
'h' => $out, 'h' => $out,
't' => current_datetime()->getTimestamp(), 't' => time(),
); );
} else { } else {
$res[] = array( $res[] = array(
's' => $slug, 's' => $slug,
'h' => $out, 'h' => $out,
't' => current_datetime()->getTimestamp(), 't' => time(),
); );
} }
} }