Support Forum
Support › MB User Meta › email is always requiredResolved
When adding an additional email field to the user profile, this email is always required, regardless of the required attribute is set to true or not.
Hello,
I do not see that issue on my end. Can you please export the field group or generate the PHP code and share it here? You can also try to deactivate all plugins and leave only Meta Box, MB extensions activate, switch to a standard theme of WordPress and check this issue again.
Hey Peter,
I switched to the 2023 theme, deactivated all plugins except
MB Custom Post Types & Custom Taxonomies
MB Settings Page
MB User Meta
Meta Box
Meta Box Builder
Meta Box Group
The Meta Box Builder PHP Export is:
<?php
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
function your_prefix_function_name( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'Paten-Profil', 'your-text-domain' ),
'id' => 'user-profile',
'type' => 'user',
'fields' => [
[
'name' => __( 'Profil-Bild', 'your-text-domain' ),
'id' => $prefix . 'profile_image',
'type' => 'single_image',
],
[
'name' => __( 'Fragen und Antworten', 'your-text-domain' ),
'id' => $prefix . 'qa',
'type' => 'group',
'clone' => true,
'sort_clone' => true,
'fields' => [
[
'name' => __( 'Frage', 'your-text-domain' ),
'id' => $prefix . 'question',
'type' => 'taxonomy_advanced',
'field_type' => 'select_advanced',
],
[
'name' => __( 'Antwort', 'your-text-domain' ),
'id' => $prefix . 'answer',
'type' => 'wysiwyg',
],
],
],
[
'name' => __( 'E-Mail', 'your-text-domain' ),
'id' => $prefix . 'email',
'type' => 'email',
'label_description' => __( 'Abweichende E-Mail-Adresse', 'your-text-domain' ),
'desc' => __( 'Wenn keine E-Mail-Adresse eingetragen wird, wird die E-Mail-Adresse dieses Kontos verwendet.', 'your-text-domain' ),
],
[
'name' => __( 'Crew United ID', 'your-text-domain' ),
'id' => $prefix . 'cu_id',
'type' => 'text',
],
[
'name' => __( 'Patenschaft', 'your-text-domain' ),
'id' => $prefix . 'mentoring',
'type' => 'taxonomy',
'field_type' => 'select_advanced',
'multiple' => true,
],
],
];
return $meta_boxes;
}
the problem still persists
Hello,
I run the PHP code on my demo site and do not see that issue, here is the screenshot https://monosnap.com/file/rhqjAvQUExFP6YXFew24az4uNtSKiO
Do you have any user meta field on your site?
Hey Peter,
I assume you have not tried to update the profile. However, I solved it. It should also happen on your site. This only happens if the field ID is 'email'. I guess it conflicts with the native email field.
Hello,
Correct, the default email field in the user profile has the same ID email
. In my profile, it already has value so I do not see the issue.