From 197b9dddc2221710b3fe8925e60a0ff3e786564b Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Mon, 28 Oct 2024 14:54:05 +0600 Subject: [PATCH 1/2] fix: Event Created in FrontEnd not working --- .../Post_Form_Template_Events_Calendar.php | 55 +++++++++++-------- includes/Fields/Form_Field_Dropdown.php | 2 + includes/Fields/Form_Field_Radio.php | 3 +- includes/Integrations.php | 10 ++-- includes/Integrations/The_Events_Calendar.php | 35 ++++++++++++ includes/Traits/FieldableTrait.php | 10 ++++ 6 files changed, 86 insertions(+), 29 deletions(-) create mode 100644 includes/Integrations/The_Events_Calendar.php diff --git a/includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php b/includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php index 170d2777e..e9a14aec8 100644 --- a/includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php +++ b/includes/Admin/Forms/Post/Templates/Post_Form_Template_Events_Calendar.php @@ -94,34 +94,41 @@ public function __construct() { 'wpuf_cond' => $this->conditionals, ], [ - 'input_type' => 'url', - 'template' => 'website_url', - 'required' => 'no', - 'label' => __( 'Event Website', 'wp-user-frontend' ), - 'name' => '_EventURL', - 'is_meta' => 'yes', - 'width' => 'large', - 'size' => 40, - 'wpuf_cond' => $this->conditionals, + 'input_type' => 'url', + 'template' => 'website_url', + 'required' => 'no', + 'label' => __( 'Event Website', 'wp-user-frontend' ), + 'name' => '_EventURL', + 'placeholder' => '', + 'default' => '', + 'is_meta' => 'yes', + 'width' => 'large', + 'size' => 40, + 'wpuf_cond' => $this->conditionals, ], [ - 'input_type' => 'text', - 'template' => 'text_field', - 'required' => 'no', - 'label' => __( 'Currency Symbol', 'wp-user-frontend' ), - 'name' => '_EventCurrencySymbol', - 'is_meta' => 'yes', - 'size' => 40, - 'wpuf_cond' => $this->conditionals, + 'input_type' => 'text', + 'template' => 'text_field', + 'required' => 'no', + 'label' => __( 'Currency Symbol', 'wp-user-frontend' ), + 'name' => '_EventCurrencySymbol', + 'placeholder' => '', + 'default' => '', + 'is_meta' => 'yes', + 'size' => 40, + 'wpuf_cond' => $this->conditionals, ], [ - 'input_type' => 'text', - 'template' => 'text_field', - 'required' => 'no', - 'label' => __( 'Cost', 'wp-user-frontend' ), - 'name' => '_EventCost', - 'is_meta' => 'yes', - 'wpuf_cond' => $this->conditionals, + 'input_type' => 'text', + 'template' => 'text_field', + 'required' => 'no', + 'label' => __( 'Cost', 'wp-user-frontend' ), + 'name' => '_EventCost', + 'placeholder' => '', + 'default' => '', + 'size' => 40, + 'is_meta' => 'yes', + 'wpuf_cond' => $this->conditionals, ], [ 'input_type' => 'image_upload', diff --git a/includes/Fields/Form_Field_Dropdown.php b/includes/Fields/Form_Field_Dropdown.php index e10a1d6aa..cfdde10bb 100755 --- a/includes/Fields/Form_Field_Dropdown.php +++ b/includes/Fields/Form_Field_Dropdown.php @@ -2,6 +2,8 @@ namespace WeDevs\Wpuf\Fields; +use WP_Query; + /** * DropDown Field Class */ diff --git a/includes/Fields/Form_Field_Radio.php b/includes/Fields/Form_Field_Radio.php index 2a4537510..80aa4c570 100755 --- a/includes/Fields/Form_Field_Radio.php +++ b/includes/Fields/Form_Field_Radio.php @@ -38,13 +38,14 @@ public function render( $field_settings, $form_id, $type = 'post', $post_id = nu $this->field_print_label( $field_settings, $form_id ); - do_action( 'WPUF_radio_field_after_label', $field_settings ); ?> + do_action( 'wpuf_radio_field_after_label', $field_settings ); ?>
0 ) { foreach ( $field_settings['options'] as $value => $option ) { + $selected = is_array( $selected ) ? '' : $selected; ?>