I want to detect in my plugin (or functions.php), if a variable POST is just sent. I mean, when the admin change the role of a user, the variable post ROLE is sent.
<select name="role" id="role">
<option value="shop_manager">Shop manager</option>
<option value="customer">Customer</option>
<option selected="selected" value="level_1">Level 1</option>
<option value="subscriber">Subscriber</option>
<option value="contributor">Contributor</option>
<option value="author">Author</option>
<option value="editor">Editor</option>
<option value="administrator">Administrator</option><option value="">— No role for this site —</option>
add_action('edit_user_profile', 'CheckPost', 10, 1);//loading on user-edit.php
$rolemodified = $_POST['role'];
function CheckPost(){
if( !empty($rolemodified) ){ echo "ROLE: $rolemodified "; }
}
I want to retrieve this $_POST['role']; or show it on an alert
echo "<script type='text/javascript'>alert('post:');</script>";
Thanks