Skip to content

Add: Append avatar to bottom of membership card #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Append Avatar to Bottom of Membership Card
*
* This recipe appends a member's avatar image to the bottom of the Membership Card.
*
* title: Append Avatar to Bottom of Membership Card
* layout: snippet
* collection: add-ons, pmpro-membership-card
* category: profile-display
* link: https://www.paidmembershipspro.com/customize-membership-card-wordpress/
*
* 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_pmpro_add_avatar_after_member_card( $pmpro_membership_card_user, $print_sizes, $qr_code, $qr_data ){

echo "<p>".get_avatar( $pmpro_membership_card_user->user_email, 96 )."</p>"; //Wrapping content in <p> tags will help with consistent spacing

}
add_action( 'pmpro_membership_card_after_card', 'my_pmpro_add_avatar_after_member_card', 10, 4 );