Adding javascript trigger to user role selection on the user-edit page
You can use jQuery or plain javascript to add event listener to the role select element. E.g. jQuery(document).on(‘ready’, function(){ jQuery(‘select#role’).on(‘change’, function(){ // some if statement here alert(‘Role changed’); }); }); To add this to your admin you can either use admin_enqueue_scripts or admin_footer hooks. To enqueue script file, function my_admin_enqueue_scripts( $hook_suffix ) { if ( … Read more