Send email to user if their role is changed to Author
Check for the value of $new_role before sending the email, if it isn’t author then do nothing function user_role_update( $user_id, $new_role ) { if ( $new_role == ‘author’ ) { $site_url = get_bloginfo( ‘wpurl’ ); $user_info = get_userdata( $user_id ); $to = $user_info->user_email; $subject=”Role changed: ” . $site_url . ”; $message=”Hello ” . $user_info->display_name . … Read more