Incorrect Role Fallback
turtlepod opened this issue · 1 comments
turtlepod commented
In this log code, the default is "Subscriber" but in WordPress we can set the default Role.
Maybe a better code is:
$role = ( ! empty( $userdata['role'] ) ) ? $userdata['role'] : get_option( 'default_role' );
turtlepod commented
After thinking about it, it actually better to simply use n/a if it's not available. A log need to simply log the actual data.
$role = ( ! empty( $userdata['role'] ) ) ? $userdata['role'] : 'n/a';