Skip to content

Commit

Permalink
Merge pull request #1494 from sapayth/fix/events_calendar_post_form_i…
Browse files Browse the repository at this point in the history
…ntegration

fix: events calendar post form integration
  • Loading branch information
sapayth authored Nov 11, 2024
2 parents 58a3680 + 1a495aa commit d02f506
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions includes/Fields/Form_Field_Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WeDevs\Wpuf\Fields;

use WP_Query;

/**
* DropDown Field Class
*/
Expand Down
3 changes: 2 additions & 1 deletion includes/Fields/Form_Field_Radio.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ); ?>

<div class="wpuf-fields">

<?php
if ( $field_settings['options'] && count( $field_settings['options'] ) > 0 ) {
foreach ( $field_settings['options'] as $value => $option ) {
$selected = is_array( $selected ) ? '' : $selected;
?>

<label <?php echo $field_settings['inline'] == 'yes' ? 'class="wpuf-radio-inline"' : 'class="wpuf-radio-block"'; ?>>
Expand Down
10 changes: 10 additions & 0 deletions includes/Traits/FieldableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ public function update_post_meta( $meta_vars, $post_id ) {
[ $meta_key_value, $multi_repeated, $files ] = self::prepare_meta_fields( $meta_vars );
// set featured image if there's any

/**
* Fires before updating post meta fields
*
* @param int $post_id
* @param array $meta_key_value
* @param array $multi_repeated
* @param array $files
*/
do_action( 'wpuf_before_updating_post_meta_fields', $post_id, $meta_key_value, $multi_repeated, $files );

// @codingStandardsIgnoreStart
$wpuf_files = isset( $_POST['wpuf_files'] ) ? $_POST['wpuf_files'] : [];

Expand Down

0 comments on commit d02f506

Please sign in to comment.