- fixed upgrade script;

This commit is contained in:
Nikita Sinelnikov
2022-08-15 14:25:19 +03:00
parent 6aa634f812
commit 5281c1e654
4 changed files with 10 additions and 4 deletions
+6
View File
@@ -21,11 +21,17 @@ function um_upgrade_phone_fields250() {
continue;
}
$need_update = false;
foreach ( $forms_fields as $key => &$field ) {
if ( in_array( $key, array( 'phone_number', 'mobile_number' ), true ) ) {
$field['type'] = 'tel';
$need_update = true;
}
}
if ( $need_update ) {
update_post_meta( $form_id, '_um_custom_fields', $forms_fields );
}
}
// remove cached option with users count, don't create separate AJAX upgrade for that
+2 -2
View File
@@ -246,14 +246,14 @@ if ( ! class_exists( 'um\core\Builtin' ) ) {
),
'tel' => array(
'name' => 'Tel Box',
'name' => __( 'Telephone Box', 'ultimate-member' ),
'col1' => array('_title','_metakey','_help','_default','_min_chars','_visibility'),
'col2' => array('_label','_placeholder','_public','_roles','_validate','_custom_validate','_max_chars'),
'col3' => array('_required','_editable','_icon'),
'validate' => array(
'_title' => array(
'mode' => 'required',
'error' => __('You must provide a title','ultimate-member')
'error' => __('You must provide a title','ultimate-member'),
),
'_metakey' => array(
'mode' => 'unique',