array( 'type' => 'integer', 'minimum' => 1, 'description' => __( 'The event, page or other ticketed post.', 'acrossai-abilities-manager' ), ), ); } protected function required_input(): array { return array( 'post_id' ); } protected function output_properties(): array { return array( 'summary' => array( 'type' => 'object' ), ); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } protected function suggested_abilities(): array { return array( array( 'slug' => 'tickets/list-attendees', 'reason' => __( 'When you genuinely need who rather than how many. That one discloses personal data and says so.', 'acrossai-abilities-manager' ), ), ); } protected function run( array $input ) { $post_id = (int) $input['post_id']; $post = Ticket_Repository::require_ticketable( $post_id ); if ( is_wp_error( $post ) ) { return $post; } $summary = Attendee_Repository::summary( $post_id ); return array( 'summary' => $summary, 'message' => sprintf( /* translators: 1: attendee count, 2: checked-in count */ __( '%1$d attendee(s), %2$d checked in.', 'acrossai-abilities-manager' ), $summary['attendees'], $summary['checked_in'] ), ); } }