Skip to content

Instantly share code, notes, and snippets.

@gausam
Created October 21, 2020 14:41
Show Gist options
  • Save gausam/6244e85720ab6cd23da5a5be24022dd1 to your computer and use it in GitHub Desktop.
Save gausam/6244e85720ab6cd23da5a5be24022dd1 to your computer and use it in GitHub Desktop.
Change the order of fields on the on the Member Profile Edit page.
<?php
/**
* This recipe changes the order of fields on the on the Member Profile Edit page.
*
* 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 mypmpro_member_profile_edit_user_object_fields($fields) {
$fields = array(
'user_email' => __( 'Email', 'paid-memberships-pro' ),
'display_name' => __( 'Display name publicly as', 'paid-memberships-pro' ),
'last_name' => __( 'Last Name', 'paid-memberships-pro' ),
'first_name' => __( 'First Name', 'paid-memberships-pro' ),
);
return $fields;
}
add_filter('pmpro_member_profile_edit_user_object_fields', 'mypmpro_member_profile_edit_user_object_fields');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment