ActionScheduler_wpCommentLogger::get_logs()
Метод класса: ActionScheduler_wpCommentLogger{}
Хуков нет.
Возвращает
ActionScheduler_LogEntry[]
.
Использование
$ActionScheduler_wpCommentLogger = new ActionScheduler_wpCommentLogger(); $ActionScheduler_wpCommentLogger->get_logs( $action_id );
- $action_id(строка) (обязательный)
- -
Код ActionScheduler_wpCommentLogger::get_logs() ActionScheduler wpCommentLogger::get logs WC 9.2.3
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; }