Forked from strangerstudios/pmpro_expiration_date_shortcode_bbpress_profile.php
Last active
February 21, 2022 11:39
-
-
Save kimcoleman/769fea41034a495df6d0266e99bc4453 to your computer and use it in GitHub Desktop.
Show a member's expiration date on bbPress profile 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 | |
/** | |
* Use this recipe in conjunction with PMPro bbPress Add On to show the expiration date on single forum user profile. | |
* | |
* 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. | |
* | |
*/ | |
function my_bbp_template_before_user_profile_pmpro_expiration_date() { | |
$user_id = bbp_get_user_id( 0, true, false ); | |
?> | |
<div class="bbp-user-section">Membership expires on <?php echo do_shortcode('[pmpro_member field="membership_enddate" user_id="' . $user_id . '"]'); ?></p></div> | |
<?php | |
} | |
add_action('bbp_template_before_user_profile', 'my_bbp_template_before_user_profile_pmpro_expiration_date', 15, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment