Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimcoleman/f6c9002f7f7b462fd9ac7c0d79860400 to your computer and use it in GitHub Desktop.
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.
<?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