If user is Admin or another role

If I understand you correctly, you want to determine if the user has any role that is in some pre-defined list like this: $accepted_roles = array( ‘administrator’, ‘editor’, ); if ( ! empty( array_intersect( $accepted_roles, $user->roles ) ) ) { …

How to make registration activation email “to” field use registrant’s first name

Add the following code to your theme’s functions.php file if the plugin provides a filter for modifying email headers: function custom_user_registration_email_to_field( $email ) { $user_id = $email->get_user_id(); $user = get_userdata( $user_id ); if ( ! empty( $user->first_name ) ) { $email->set_to( $user->first_name . ‘ <‘ . $user->user_email . ‘>’ ); } return $email; } add_filter( … Read more