Created
August 11, 2020 14:58
-
-
Save kimcoleman/51f98a92e84830e6ad5fe6ba5c407d55 to your computer and use it in GitHub Desktop.
Add nickname to the Member Profile Edit frontend page.
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 | |
| /** | |
| * Add nickname to the Member Profile Edit frontend 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 add_nickname_pmprorh_user_table_fields( $user_table_fields ) { | |
| // Set the return value to an array if it is not one. | |
| if ( ! is_array( $user_table_fields ) ) { | |
| $user_table_fields = array(); | |
| } | |
| // Add nicename as a new field. | |
| $user_table_fields[] = 'user_nicename'; | |
| return $user_table_fields; | |
| } | |
| add_filter( 'pmprorh_user_table_fields', 'add_nickname_pmprorh_user_table_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment