array( 'type' => 'integer', 'minimum' => 1, ), ); } protected function output_properties(): array { return array( 'form_id' => array( 'type' => 'integer' ), 'fields' => array( 'type' => 'array' ), 'count' => array( 'type' => 'integer' ), ); } protected function required_input(): array { return array( 'form_id' ); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } protected function run( array $input ) { $form = Form_Repository::get( absint( $input['form_id'] ?? 0 ) ); if ( is_wp_error( $form ) ) { return $form; } $fields = Form_Tag_Repository::tags( $form ); return array( 'form_id' => (int) $form->id(), 'fields' => $fields, 'count' => count( $fields ), 'message' => sprintf( /* translators: %d: number of fields */ _n( '%d field.', '%d fields.', count( $fields ), 'acrossai-abilities-manager' ), count( $fields ) ), ); } }