test

//create a hidden field for role and extra fields needed
add_action(‘register_form’,’add_hidden_role_field’);

function add_hidden_role_field(){
if (isset($_GET[‘role’])){
$user_type = $_GET[‘role’];
echo ‘‘;
}
if (isset($user_type) && $user_type == “seller”){
//add extra seller fields here eg:
?>
business name:

business address:


buyer name:

add(’empty_business_name’, “ERROR: Please Enter in a Business name”);
}
if ($_POST[‘business_address’] == ”) {
$errors->add(’empty_business_address’, “ERROR: Please Enter in Business address”);
}
}
if (isset($user_type) && $user_type == “buyer”){
//check buyers fields
if ($_POST[‘buyer_name’] == ”) {
$errors->add(’empty_buyer_name’, “ERROR: Please Enter in a Buyer name”);
}
}
}

Skip to toolbar