From df78e3de80f8116d6e14c358fa23f1e6dab4d22e Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Wed, 30 Oct 2019 12:28:51 -0700 Subject: [PATCH] Pledge Form: Also allow `user_nicename` to improve UX. Fixes #57 --- plugins/wporg-5ftf/includes/pledge-form.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/wporg-5ftf/includes/pledge-form.php b/plugins/wporg-5ftf/includes/pledge-form.php index 21ef9a9..bd2cb15 100755 --- a/plugins/wporg-5ftf/includes/pledge-form.php +++ b/plugins/wporg-5ftf/includes/pledge-form.php @@ -316,6 +316,10 @@ function parse_contributors( $contributors ) { $sanitized_username = sanitize_user( $wporg_username ); $user = get_user_by( 'login', $sanitized_username ); + if ( ! $user instanceof WP_User ) { + $user = get_user_by( 'slug', $sanitized_username ); + } + if ( $user instanceof WP_User ) { $sanitized_contributors[] = $sanitized_username; } else {