Created
May 7, 2020 11:18
-
-
Save kimcoleman/1ad33c95d6e20ed1b5b2e7bb98d3a65c to your computer and use it in GitHub Desktop.
Show the user's avatar before the menu area in the Log In Form widget for PMPro v2.3+
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 user's avatar before the menu area in the Log In Form widget for PMPro v2.3+ | |
* | |
*/ | |
function my_pmpro_log_in_form_widget_avatar() { | |
global $current_user; | |
echo get_avatar( $current_user->ID, '80', '', $current_user->display_name ); | |
} | |
add_action( 'pmpro_logged_in_welcome_before_menu', 'my_pmpro_log_in_form_widget_avatar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This recipe is included in the blog post on "How to Show the User’s Avatar in the Log In Form Widget" at Paid Memberships Pro here: https://www.paidmembershipspro.com/show-user-avatar-in-widget/