View difference between Paste ID: NhLQV0Nc and w2i07KbL
SHOW: | | - or go back to the newest paste.
1-
//Add Role To Register Link
1+
2-
add_action('register_form', 'register_role_custom');
2+
	<?php 
3
	if (isset($_GET['role'])){
4
		$customRole = $_GET['role'];
5
	} 
6-
	<input id="role" type="hidden" tabindex="0" size="0" value= "<?php if (isset($_GET['role'])){echo $_GET['role'];} ?>" name="role"/>
6+
	else{
7
		$customRole = $_POST['role'];
8
	}
9-
}
9+
	?>
10
	<input id="role" type="hidden" tabindex="0" size="0" value= "<?php echo $customRole;?>" name="role"/>
11-
add_action('user_register', 'custom_user_role');
11+
12
<?php
13-
function custom_user_role($user_id, $password="", $meta=array()) {
13+