Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryOJob/f9961e4702f972a239b8b15863bcc4ac to your computer and use it in GitHub Desktop.
Save MaryOJob/f9961e4702f972a239b8b15863bcc4ac to your computer and use it in GitHub Desktop.
PMPro - Change Never Label Message for Recurring Levels
<?php
/**
* Changes the output label to Recurring in member/order lists for recurring levels.
*
* 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.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
/**
* Checks if a level is recurring and modifies output label.
*/
function my_pmpro_change_membership_expires_label( $date_format, $pmpro_user_data ) {
if ( function_exists( 'pmpro_has_recurring_level' ) ) {
if ( pmpro_has_recurring_level( $pmpro_user_data->ID ) ) {
return 'Recurring';
}
}
return $date_format;
}
add_filter( 'pmpro_memberslist_expires_column', 'my_pmpro_change_membership_expires_label', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment