Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kimcoleman/51f98a92e84830e6ad5fe6ba5c407d55 to your computer and use it in GitHub Desktop.

Select an option

Save kimcoleman/51f98a92e84830e6ad5fe6ba5c407d55 to your computer and use it in GitHub Desktop.
Add nickname to the Member Profile Edit frontend page.
<?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