Created
June 24, 2024 08:22
-
-
Save ipokkel/3f934e8675ba5cc30e3c5de7a72b4d98 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 | |
/** | |
* Show the display name field for administrators in the WordPress dashboard. | |
* | |
* 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_ffl_show_display_name_for_admins( $hide_display_name, $user ) { | |
// bail if not in dashboard and not an administrator | |
if ( is_admin() && $hide_display_name && current_user_can( 'edit_users' ) ) { | |
return false; | |
} | |
return $hide_display_name; | |
} | |
add_filter( 'pmpro_ffl_hide_display_name_profile', 'my_ffl_show_display_name_for_admins', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment