Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove or Rename User Fields on the Member Profile Edit Page #213

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions frontend-pages/remove-rename-user-fields-member-profile-edit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* Removes the First Name and Last Name fields on the Member Profile Edit page.
* Renames the "Display Name" field to just "Name".
*
* title: Remove or Rename User Fields on the Member Profile Edit Page
* layout: snippet
* collection: frontend-pages
* category: profile, account
* link: https://www.paidmembershipspro.com/remove-rename-user-fields-member-profile-edit/
*
* 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.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_member_profile_edit_user_object_fields( $user_fields ) {
unset( $user_fields['first_name'] );
unset( $user_fields['last_name'] );
$user_fields['display_name'] = 'Name';
return $user_fields;
}
add_filter( 'pmpro_member_profile_edit_user_object_fields', 'my_pmpro_member_profile_edit_user_object_fields' );