Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimcoleman/1ad33c95d6e20ed1b5b2e7bb98d3a65c to your computer and use it in GitHub Desktop.
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+
<?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' );
@laurenhagan0306
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment