}> $students * @var string $pageSlug */ /** * The Family cell: for a child, the guardian who books for them; for a guardian, * the children they book for. Both link to the other person's detail screen so * an admin can move between a family without going back to the list. */ $familyCell = static function (array $student) use ($pageSlug): string { $link = static fn(int $id, string $name): string => sprintf( '%s', esc_url(add_query_arg(['page' => $pageSlug, 'student_id' => $id], admin_url('admin.php'))), esc_html($name) ); if ($student['guardian'] !== null) { return sprintf( /* translators: %s: linked name of the parent/guardian who books for this student. */ esc_html__('Managed by %s', 'unsupervised-schedular'), $link($student['guardian']['id'], $student['guardian']['name']) ); } if ($student['children'] === []) { return '—'; } return implode(', ', array_map( static fn(array $child): string => $link($child['id'], $child['name']), $student['children'] )); }; ?>