Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created August 3, 2026 10:29
Show Gist options
  • Select an option

  • Save andrewlimaza/2e41478c03e95e7c66c464fecf12850f to your computer and use it in GitHub Desktop.

Select an option

Save andrewlimaza/2e41478c03e95e7c66c464fecf12850f to your computer and use it in GitHub Desktop.
Show "Renew" on Account page for any member expiring (regardless of days remaining).
<?php
// Show renew link on all levels that have an expiration date on the PMPro account page.
function my_pmpro_expiring_soon_if_member_has_enddate( $expiring_soon, $level ) {
if ( empty( $level->id ) || ! is_user_logged_in() ) {
return $expiring_soon;
}
// Get the current user's membership for this level ID, including its assigned enddate.
$member_level = pmpro_getSpecificMembershipLevelForUser( get_current_user_id(), (int) $level->id );
if ( ! empty( $member_level->enddate ) ) {
$expiring_soon = true;
}
return $expiring_soon;
}
add_filter( 'pmpro_is_level_expiring_soon', 'my_pmpro_expiring_soon_if_member_has_enddate', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment