Simply add the below code in the functions.php file of the current theme to add the “First name” and “Last name” in the vendor registration form and retrieve those details.
add_action('mvx_vendor_register_form', 'mvx_vendor_register_form_fields');
function mvx_vendor_register_form_fields() {
?>
<p>
<label>First Name<br/>
<input type="text" name="first_name" id="first_name" class="input" value="" size="25" tabindex="30" />
</label>
</p>
<p>
<label>Last Name<br/>
<input type="text" name="last_name" id="last_name" class="input" value="" size="25" tabindex="40" />
</label>
</p>
<?php
}
add_action('mvx_after_register_vendor', 'vendor_registration_formdata_save');
function vendor_registration_formdata_save($user_id) {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['first_name'])) {
update_user_meta($user_id, 'first_name', sanitize_text_field($_POST['first_name']));
}
if (isset($_POST['last_name'])) {
update_user_meta($user_id, 'last_name', sanitize_text_field($_POST['last_name']));
}
}
}






