In order to do what you want , you can add whatever fields you want, and then store them in the user_meta
…
(One could also store them in the $user_info
array/object, but I am not sure what would be the benefit .. )
// Render Form Fields
add_action('register_form','k99_register_form_add_theme_field');
// Checking
add_action('register_post','k99_check_fields',10,3);
// Insert Data
add_action('user_register', 'k99_register_new_register_fields');
// Render the form with the additional radio field
function k99_register_form_add_theme_field(){
?>
<p>
<label>Theme<br />
<?php $themes=wp_get_themes();
foreach ($themes as $theme ) {
$theme['Name'] = sanitize_title_with_dashes($theme['Name']);
$checked = checked( $_POST['custom_theme'], 1 );
echo '<input id="custom_theme'.$theme['Name'] .'" type="radio" name="custom_theme" value="'. $theme['Name'] .'" '.$checked.'> '. $theme['Name'].'<br />';
$custom_theme = $_POST['custom_theme'];
} ?>
</label>
</p>
<?php
}
// checking , sanitation etc .. of course this is not done...
function k99_check_fields($login, $email, $errors) {
global $custom_theme;
if ($_POST['custom_theme'] == '') {
$errors->add('empty_theme', "<strong>Error:</strong> Please select theme.");
}
else {
$custom_theme = $_POST['custom_theme'];
}
}
// Write to DB ... if you will..
function k99_register_new_register_fields($user_id, $password="", $meta=array()) {
$custom_theme = $_POST['custom_theme']; //just in case ..
update_usermeta($user_id, 'user_custom_theme',$custom_theme);
}
after all of that you can retrieve the user_theme like so :
get_user_meta($user_id, 'user_custom_theme', true);
NOTE : This was written On-The-Fly. It was not verified on multi-blog, but on a simple wp installation , and although there should not be much difference – still this is not a production function, it was only to put you on the right track. Sanitation and checking on variables, cleaning code and FORM MARKUP are needed , as well as adding the field also to other user related screens (create user, edit user, edit profile etc..) .
NOTE II: you asked about gravity forms in your uodate – they have an add-on for that