ActionScheduler_wpCommentLogger::create_wp_comment()protectedWC 1.0

Метод класса: ActionScheduler_wpCommentLogger{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->create_wp_comment( $action_id, $message, $date );
$action_id (обязательный)
-
$message (обязательный)
-
$date(DateTime) (обязательный)
-

Код ActionScheduler_wpCommentLogger::create_wp_comment() WC 8.7.0

protected function create_wp_comment( $action_id, $message, DateTime $date ) {

	$comment_date_gmt = $date->format('Y-m-d H:i:s');
	ActionScheduler_TimezoneHelper::set_local_timezone( $date );
	$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,
		'comment_type' => self::TYPE,
	);
	return wp_insert_comment($comment_data);
}