ActionScheduler_wpCommentLogger::get_logs()publicWC 1.0

Get action's logs.

Method of the class: ActionScheduler_wpCommentLogger{}

No Hooks.

Return

ActionScheduler_LogEntry[].

Usage

$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger();
$ActionScheduler_wpCommentLogger->get_logs( $action_id );
$action_id(string) (required)
Action ID.

ActionScheduler_wpCommentLogger::get_logs() code WC 9.4.2

public function get_logs( $action_id ) {
	$status = 'all';
	if ( get_post_status($action_id) == 'trash' ) {
		$status = 'post-trashed';
	}
	$comments = get_comments(array(
		'post_id' => $action_id,
		'orderby' => 'comment_date_gmt',
		'order' => 'ASC',
		'type' => self::TYPE,
		'status' => $status,
	));
	$logs = array();
	foreach ( $comments as $c ) {
		$entry = $this->get_entry( $c );
		if ( !empty($entry) ) {
			$logs[] = $entry;
		}
	}
	return $logs;
}