ActionScheduler_wpCommentLogger::get_logs()
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() 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; }