WordPress at Your Fingertips
function is not described

ActionScheduler_wpCommentLogger::create_wp_comment() protected WC 1.0

{} It's a method of the class: ActionScheduler_wpCommentLogger{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->create_wp_comment( $action_id, $message, $date );
$action_id (required)
-
$message (required)
-
$date(DateTime) (required)
-

Code of ActionScheduler_wpCommentLogger::create_wp_comment() WC 6.1.1

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);
}