ActionScheduler_DBLogger::get_logs()publicWC 1.0

Retrieve the an action's log entries from the database.

{} Это метод класса: ActionScheduler_DBLogger{}

Хуков нет.

Возвращает

ActionScheduler_LogEntry[].

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

$ActionScheduler_DBLogger = new ActionScheduler_DBLogger();
$ActionScheduler_DBLogger->get_logs( $action_id );
$action_id(int) (обязательный)
Action ID.

Код ActionScheduler_DBLogger::get_logs() WC 6.9.4

public function get_logs( $action_id ) {
	/** @var \wpdb $wpdb */ //phpcs:ignore Generic.Commenting.DocComment.MissingShort
	global $wpdb;

	$records = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->actionscheduler_logs} WHERE action_id=%d", $action_id ) );

	return array_map( array( $this, 'create_entry_from_db_record' ), $records );
}