From 984e191bc632b6c5f351e8ff37590a4a4a8a22cb Mon Sep 17 00:00:00 2001 From: Andrew Lima Date: Mon, 10 Jun 2024 15:32:02 +0200 Subject: [PATCH 1/2] Added functionality for Avatar images * ENHANCEMENT: Add the ability to show_avatar attribute to show the members avatar. * ENHANCEMENT: New filter added to give you even more control over the avatar settings - pmpro_membership_card_avatar_args (takes an array of values that passes through to the get_avatar function). --- pmpro-membership-card.php | 3 +- templates/membership-card.php | 60 ++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/pmpro-membership-card.php b/pmpro-membership-card.php index 3c94bad..a9f7ad0 100644 --- a/pmpro-membership-card.php +++ b/pmpro-membership-card.php @@ -111,7 +111,8 @@ function pmpro_membership_card_shortcode($atts, $content=null, $code="") extract(shortcode_atts(array( 'print_size' => 'all', 'qr_code' => 'false', - 'qr_data' => 'ID' // Accepts ID, email and level + 'qr_data' => 'ID', // Accepts ID, email and level + 'show_avatar' => 'false' ), $atts)); $print_sizes = explode(",", $print_size); diff --git a/templates/membership-card.php b/templates/membership-card.php index 6fdb692..2593f55 100644 --- a/templates/membership-card.php +++ b/templates/membership-card.php @@ -22,7 +22,11 @@ else $print_large = false; - + if ( $show_avatar === 'false' ) { + $show_avatar = false; + } else { + $show_avatar = true; + } ?>