Created
June 24, 2024 07:05
-
-
Save ipokkel/3fccd818dd3d7216d740c6ecf0b009f6 to your computer and use it in GitHub Desktop.
This file contains 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 the display_name field to the wp_users table. | |
* | |
* 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/ | |
*/ | |
// Set display_name field to be saved in the wp_user table | |
function my_pmpro_add_display_name_as_user_table_field( $fields_array ) { | |
$fields_array[] = 'display_name'; | |
return $fields_array; | |
} | |
add_filter( 'pmprorh_user_table_fields', 'my_pmpro_add_display_name_as_user_table_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment