mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-10 03:22:57 +00:00
2.0.19
This commit is contained in:
@@ -16,19 +16,21 @@ class ActionScheduler_wpCommentLogger extends ActionScheduler_Logger {
|
||||
*/
|
||||
public function log( $action_id, $message, DateTime $date = NULL ) {
|
||||
if ( empty($date) ) {
|
||||
$date = new DateTime();
|
||||
$date = as_get_datetime_object();
|
||||
} else {
|
||||
$date = clone( $date );
|
||||
$date = clone $date;
|
||||
}
|
||||
$comment_id = $this->create_wp_comment( $action_id, $message, $date );
|
||||
return $comment_id;
|
||||
}
|
||||
|
||||
protected function create_wp_comment( $action_id, $message, DateTime $date ) {
|
||||
$comment_date_gmt = $date->format('Y-m-d H:i:s');
|
||||
$date->setTimezone( ActionScheduler_TimezoneHelper::get_local_timezone() );
|
||||
$comment_data = array(
|
||||
'comment_post_ID' => $action_id,
|
||||
'comment_date' => $date->format('Y-m-d H:i:s'),
|
||||
'comment_date_gmt' => $comment_date_gmt,
|
||||
'comment_author' => self::AGENT,
|
||||
'comment_content' => $message,
|
||||
'comment_agent' => self::AGENT,
|
||||
|
Reference in New Issue
Block a user