name = 'vizyt_service'; $this->label = __( 'Vizyt service', 'vizyt' ); parent::__construct(); } protected function choices(): array { $choices = []; foreach ( Service::getPublicList() as $row ) { $label = (string) $row->name . ' · ' . (int) $row->duration . ' min'; if ( ! empty( $row->category_name ) ) { $label = $row->category_name . ' — ' . $label; } $choices[ (int) $row->id ] = $label; } return $choices; } protected function item( int $id ): ?array { return vizyt_get_service( $id ); } protected function shortcode_attr(): string { return 'service_id'; } }