Last active
April 12, 2021 22:30
-
-
Save strangerstudios/6971fc87b780bfdd13724c27f97df796 to your computer and use it in GitHub Desktop.
Show the Member Badge for each level on the 3 column layout Membership Levels page
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 | |
/* | |
Sample method to show a level's Member Badge on the three column layout of the | |
Membership Levels page when using the Advanced Levels Page Shortcode Add On. | |
*/ | |
function my_pmproal_before_level_member_badge( $level_id, $layout ) { | |
if( function_exists( 'pmpromb_getBadgeForLevel' ) ) { | |
$image = pmpromb_getBadgeForLevel($level_id); | |
if( ! empty( $image ) && $layout == '3col' ) { | |
echo '<img class="pmpro_member_badge" src="' . esc_url($image) . '" border="0" />'; | |
} | |
} | |
} | |
add_action( 'pmproal_before_level', 'my_pmproal_before_level_member_badge', 10, 2); |
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 "Enhance Your Membership Levels Page with Member Badges" at Paid Memberships Pro here: https://www.paidmembershipspro.com/enhance-membership-levels-page-member-badges/