Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion admin/assets/js/uwp-form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@
'url': `${uwp_admin_ajax.url}?action=${action}&manage_field_type=${manageFieldType}${formIdParam}`,
'data': requestData,
'beforeSend': function () {
$('.uwp-form-settings-form #save').html('<span class="spinner-border spinner-border-sm" role="status"></span> ' + uwp_admin_ajax.txt_saving).addClass('disabled');
var $loader = $('.uwp-form-settings-form #save').length ? $('.uwp-form-settings-form #save') : $('.uwp-form-settings-form').parent().find('#save');
$loader.html('<span class="spinner-border spinner-border-sm" role="status"></span> ' + uwp_admin_ajax.txt_saving).addClass('disabled');
},
'success': function (result) {
if ($.trim(result) === 'invalid_key') {
Expand Down
2 changes: 1 addition & 1 deletion admin/assets/js/uwp-form-builder.min.js

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions admin/settings/class-formbuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1216,12 +1216,12 @@ public function admin_form_field_html( $field_info, $field_type, $field_type_key
<?php if ( $field_type == 'fieldset' ) { ?>
<i class="fas fa-long-arrow-alt-left " aria-hidden="true"></i>
<i class="fas fa-long-arrow-alt-right " aria-hidden="true"></i>
<b><?php echo esc_html( uwp_ucwords( __( 'Fieldset:', 'userswp' ) ) ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( uwp_ucwords( $field_site_title ) ) . ')'; ?></span>
<b><?php echo esc_html( __( 'Fieldset:', 'userswp' ) ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( $field_site_title ) . ')'; ?></span>
<?php } else { ?>
<?php echo $field_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<b><?php echo esc_html( uwp_ucwords( ' ' . $field_site_title ) ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( uwp_ucwords( $field_type_name ) ) . ')'; ?></span>
<b><?php echo esc_html( ' ' . $field_site_title ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( ucfirst( $field_type_name ) ) . ')'; ?></span>
<?php } ?>
</div>
<div class="dd-handle ui-sortable-handle">
Expand Down Expand Up @@ -1473,18 +1473,17 @@ public function admin_form_field_html( $field_info, $field_type, $field_type_key

// is_public
if ( has_filter( "uwp_builder_is_public_{$field_type}" ) ) {

echo apply_filters( "uwp_builder_is_public_{$field_type}", '', $result_str, $cf, $field_info ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

} else {
$value = '';

if ( isset( $field_info->is_public ) ) {
$value = esc_attr( $field_info->is_public );
} elseif ( isset( $cf['defaults']['is_public'] ) && $cf['defaults']['is_public'] ) {
$value = $cf['defaults']['is_public'];
$value = (int) $field_info->is_public;
} elseif ( isset( $cf['defaults']['is_public'] ) && ( $cf['defaults']['is_public'] || $cf['defaults']['is_public'] === '0' || $cf['defaults']['is_public'] === 0 ) ) {
$value = (int) $cf['defaults']['is_public'];
}

echo aui()->select(
aui()->select(
array(
'id' => 'is_public',
'name' => 'is_public',
Expand All @@ -1494,14 +1493,14 @@ public function admin_form_field_html( $field_info, $field_type, $field_type_key
'options' => array(
'1' => __( 'Yes', 'userswp' ),
'0' => __( 'No', 'userswp' ),
'2' => __( 'Let User Decide', 'userswp' ),
'2' => __( 'Let User Decide', 'userswp' )
),
'label' => __( 'Is Public', 'userswp' ) . uwp_help_tip( __( 'If no is selected then the field will not be visible to other users.', 'userswp' ) ),
'value' => $value,
'wrap_class' => uwp_advanced_toggle_class(),
)
'wrap_class' => uwp_advanced_toggle_class()
),
true
);

}

// default_value
Expand Down Expand Up @@ -1914,7 +1913,6 @@ public function register_field_adminhtml( $result_str, $field_ins_upd = '', $def
}
$field_info = stripslashes_deep( $field_info ); // strip slashes
}
$field_site_name = sanitize_title( $field_site_name );

if ( isset( $request['form_type'] ) ) {
$form_type = esc_attr( $request['form_type'] );
Expand Down Expand Up @@ -1959,7 +1957,8 @@ public function register_field_adminhtml( $result_str, $field_ins_upd = '', $def
?>
<div class=" flex-fill font-weight-bold fw-bold">
<?php echo $field_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<b><?php echo esc_html( uwp_ucwords( ' ' . $field_site_name ) ); ?></b>
<b><?php echo ' ' . esc_html( $field_site_name ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( ucfirst( $field_type ) ) . ')'; ?></span>
</div>
<div class="dd-handle ui-sortable-handle">
<?php if ( isset( $htmlvar_name ) && ! in_array( $htmlvar_name, $no_actions ) ) { ?>
Expand Down
4 changes: 2 additions & 2 deletions admin/settings/class-uwp-settings-profile-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ public function tabs_field_adminhtml( $result_str, $field_ins_upd = '', $request
<div class="title title<?php echo esc_attr( $result_str ); ?> uwp-fieldset hover-shadow dd-form d-flex justify-content-between rounded c-pointer list-group-item border rounded-smx text-start bg-light " onclick="uwp_tabs_item_settings(this);">
<div class=" flex-fill font-weight-bold fw-bold">
<?php echo $field_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<b><?php echo esc_html( uwp_ucwords( ' ' . $field_site_name ) ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( uwp_ucwords( $tab_type ) ) . ')'; ?></span>
<b><?php echo ' ' . esc_html( $field_site_name ); ?></b>
<span class="field-type float-end text-end small"><?php echo ' (' . esc_html( ucfirst( $tab_type ) ) . ')'; ?></span>
</div>
<div class="dd-handle ui-sortable-handle">
<i class="far fa-trash-alt text-danger ml-2 ms-2" id="delete-16"
Expand Down
14 changes: 8 additions & 6 deletions includes/class-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,16 @@ public function save_user_ip_on_login( $user_login, $user ) {
*
* @return string Date string.
*/
public function modify_datepicker_value_on_update($value, $user_id, $key) {
// modify timestamp to date
if (is_int($value)) {
$field_info = uwp_get_custom_field_info($key);
if ($field_info->field_type == 'datepicker') {
$value = date('Y-m-d', $value);
public function modify_datepicker_value_on_update( $value, $user_id, $key ) {
// Modify timestamp to date
if ( is_int( $value ) ) {
$field_info = uwp_get_custom_field_info( $key );

if ( ! empty( $field_info ) && $field_info->field_type == 'datepicker' ) {
$value = date( 'Y-m-d', $value );
}
}

return $value;
}

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ Yes, you can customize it with Elementor, but also with Gutenberg, Divi, Beaver

== Changelog ==

= 1.2.51 - 2025-12-TBD =
* Field option Is Public don't saves with No option - FIXED

= 1.2.50 - 2025-12-03 =
* WordPress v6.9 compatibility check - CHANGED

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,10 @@ public static function select( $args = array() ) {
}
} elseif ( $args['value'] === $val ) {
$selected = selected( $args['value'], $val, false );
} elseif ( ( $args['value'] === '0' || $args['value'] === 0 ) && ( $val === '0' || $val === 0 ) ) {
$selected = selected( $args['value'], $val, false );
}

$output .= '<option value="' . esc_attr( $val ) . '" ' . $selected . '>' . esc_attr( $name ) . '</option>';
}
}
Expand Down