I created this selectbox inside my user-edit.php screen trough edit_user_profile hook.
<table class="form-table">
<tbody>
<tr>
<th>
<label for="select_membership">Plano de Membros</label>
</th>
<td>
<select id="select_membership" name="select_membership"><option id="0">Sem plano</option>
<option value="1">Plano 1</option>
<option value="2" selected="selected">Plano 2</option>
<option value="3">Plano 3</option>
<option value="4">Plano 4</option>
<option value="5">Plano 5</option>
<option value="6">Plano 6</option>
<option value="7">Plano 7</option>
</select>
</td>
</tr>
</tbody>
</table>
Now I'm trying to get the selectbox value inside the user_register hook with this function:
public function update_membership_field( $user_id ){
$membership_methods = new IMS_Membership_Method();
$membership_methods->update_user_membership($user_id, $_POST['select_membership']);
}
But nothing happens. How I can know if some data is passing through this function to check if something is happening? How to debug? I can't print nothing using this function.