diff --git a/includes/forms/__form-food-delivery.php b/includes/forms/__example-form-food-delivery.php similarity index 96% rename from includes/forms/__form-food-delivery.php rename to includes/forms/__example-form-food-delivery.php index 627311b..f205222 100644 --- a/includes/forms/__form-food-delivery.php +++ b/includes/forms/__example-form-food-delivery.php @@ -1,5 +1,6 @@ 'brochures', - 'posts_per_page' => -1, - 'post_status' => 'publish', - ));; - $this->brochures_query = $post_query; - - $choices = []; - foreach ($this->brochures_query->posts as $post) { - $choices[] = ['text' => $post->post_title]; - } - } - - public function get_form_editor_field_title() - { - return esc_attr__('Commande de publications papier', 'txtdomain'); - } - 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 'gform-icon--multi-select'; - } - 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 $choices = [ - ['text' => 'Publication 1'], - ['text' => 'Publication 2'], - ['text' => 'Publication 3'], - ]; - public function is_value_submission_array() - { - return true; - } - - public function get_field_input($form, $value = '', $entry = null) - { - - // if ($this->is_form_editor()) { - // return ''; - // } - $form_id = $form['id']; - $is_entry_detail = $this->is_entry_detail(); - $id = (int) $this->id; - - write_log($id); - write_log($form_id); - - ob_start(); -?> - - -
- -
- - brochures_query->posts as $index => $brochurePost) { ?> - - -
- " type="checkbox" value="post_title ?>"> - - - " /> - " /> -
- - -
- - -
- -choices as $course) { - foreach ($this->delivery_days as $day) { - $table_value[$course['text']][$day] = $value[$counter++]; - } - } - return $table_value; - } - } - GF_Fields::register(new OrderPaperPublications()); -}