Here’s some code. You’ll see I attempted to add a filter to the registration_errors hook. That function has a print_r() in it that doesn’t fire. Also, I had a look at validate_user_form(), and I’m pretty sure that just checks that the username and email aren’t taken.
if (is_multisite()) {
add_action('signup_extra_fields','show_dm_fields');
add_filter('registration_errors', 'dm_cust_check_fields', 10, 3); // isn't any filter hook
add_filter('add_signup_meta', 'dm_cust_store_meta', 10, 3);
}
function show_dm_fields($errors)
{
?>
<hr/>
<label for="customer-request"> I'd like to trade bulk metals</label>
<input type="checkbox" id="customer-request" name="customer-request" <?php checked($_POST['customer-request']); ?>/>
<label for="name">Full Name: </label>
<input type="text" id="name" value="<?php echo $_POST['name']; ?>" />
<div class="address">
<label>Billing Address</label>
<label for="street1">Street Address: </label>
<input type="text" id="street1" name="street1" value="<?php echo $_POST['street1']; ?>" />
<label for="street2">Street Line 2: </label>
<input type="text" id="street2" name="street2" value="<?php echo $_POST['street2']; ?>" />
<label for="city">City: </label>
<input type="text" id="city" name="city" value="<?php echo $_POST['city']; ?>" />
<label for="state">State: </label>
<?php echo listUSStates('state', $_POST['state']); ?>
<label for="zip">ZIP: </label>
<input type="text" id="zip" name="zip" value="<?php echo $_POST['zip']; ?>" />
</div>
<div class="address">
<label>Shipping Address</label>
<label for="shipping-same">Same as Billing</label>
<input type="checkbox" id="shipping-same" name="street1" <?php checked($_POST['customer-request']); ?>/>
<label for="street1">Street Address: </label>
<input type="text" id="street1" name="street1" value="<?php echo $_POST['street1']; ?>" />
<label for="street2">Street Line 2: </label>
<input type="text" id="street2" name="street2" value="<?php echo $_POST['street2']; ?>" />
<label for="city">City: </label>
<input type="text" id="city" name="city" value="<?php echo $_POST['city']; ?>" />
<label for="state">State: </label>
<?php echo listUSStates('state', $_POST['state']); ?>
<label for="zip">ZIP: </label>
<input type="text" id="zip" name="zip" value="<?php echo $_POST['zip']; ?>" />
</div>
<label for="taxid">Tax ID (required for orders over $10,000): </label>
<input type="text" id="taxid" name="taxid" value="<?php echo $_POST['taxid']; ?>" />
<?php
}
// validate
function dm_cust_check_fields ( $login, $email, $errors=null)
{
if(empty($errors)) {
$errors = new WPError();
}
if ( $_POST['taxid'] == '' )
{
$errors->add( 'empty_taxid', "Please enter your tax ID number." );
}
print_r($errors);
}
function dm_cust_store_meta ($meta)
{
$meta['nickname'] = $_POST['name'];
}