$document_pdf['title'], 'text' => $document_pdf['title'], 'ID' => $document_ID, ]; $this->choices = $choices; return $choices; } public function get_form_editor_field_title() { return esc_attr__('Field de commande de la synthèse des primes', 'homegrade-theme__texte-fonctionnel'); } public function get_form_editor_button() { return [ 'group' => 'advanced_fields', 'text' => $this->get_form_editor_field_title(), ]; } public function get_form_editor_field_icon() { return 'dashicons-list-view'; } public function get_form_editor_field_settings() { return [ 'label_setting', 'choices_setting', 'description_setting', 'rules_setting', 'error_message_setting', 'css_class_setting', 'conditional_logic_field_setting' ]; } public function is_value_submission_array() { return true; } public function get_field_input($form, $value = '', $entry = null) { // $this->buildChoices(); $form_id = $form['id']; $id = $this->id; ob_start(); include 'template-field-order-documents.php'; $table = ob_get_clean(); return $table; } private function translateValueArray($value) { $this->buildChoicesArray(); $table_value = []; $counter = 0; foreach ($this->choices as $document) { $table_value[$document['text']]['quantity_fr'] = $value[$counter] ?? 0; $table_value[$document['text']]['quantity_nl'] = $value[$counter + 1] ?? 0; $counter += 2; } return $table_value; } public function get_value_save_entry($value, $form, $input_name, $lead_id, $lead) { if (empty($value)) { $value = ''; } else { $table_value = $this->translateValueArray($value); $value = serialize($table_value); } return $value; } private function PrettyListDocumentOrder($value) { $documentOrderPreviewHtml = '