Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/769fea41034a495df6d0266e99bc4453 to your computer and use it in GitHub Desktop.
Save kimcoleman/769fea41034a495df6d0266e99bc4453 to your computer and use it in GitHub Desktop.
Show a member's expiration date on bbPress profile page.
<?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