Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tejasbusiness/633f03e48cbc7ad55cc4f4727e859bb1 to your computer and use it in GitHub Desktop.
Save tejasbusiness/633f03e48cbc7ad55cc4f4727e859bb1 to your computer and use it in GitHub Desktop.
Show the Member Badge for each level on the 3 column layout Membership Levels page
<?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