Forked from strangerstudios/my_pmproal_before_level_member_badge.php
Created
May 30, 2017 03:36
-
-
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
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