Created
May 19, 2021 15:31
-
-
Save kimcoleman/f6c9002f7f7b462fd9ac7c0d79860400 to your computer and use it in GitHub Desktop.
Set the display name as the entered username for all users created through a Paid Memberships Pro checkout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Set the display name as the entered username for all users created through a Paid Memberships Pro checkout. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* | |
*/ | |
function set_display_name_to_username_new_user_array( $new_user_array ) { | |
$new_user_array['display_name'] = $new_user_array['user_login']; | |
return $new_user_array; | |
} | |
add_filter( 'pmpro_checkout_new_user_array', 'set_display_name_to_username_new_user_array' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment