Paid Memberships Pro: Add a Note to Level Prices
Appends a short note such as "plus VAT" or "cancel any time" to the price text Paid Memberships Pro shows for each level.
Opens WPIDE on
Code
if ( ! function_exists( 'pmpro_getLevel' ) ) {
return;
}
// Level ID => note. "default" covers all other levels.
$wpide_pmpro_price_notes = array(
'default' => 'Cancel any time.',
);
add_filter( 'pmpro_level_cost_text', function ( $text, $level ) use ( $wpide_pmpro_price_notes ) {
$id = is_object( $level ) && isset( $level->id ) ? (int) $level->id : 0;
$note = $wpide_pmpro_price_notes[ $id ] ?? ( $wpide_pmpro_price_notes['default'] ?? '' );
return $note ? $text . ' <span class="wpide-pmpro-price-note">' . esc_html( $note ) . '</span>' : $text;
}, 10, 2 );
Notes
Leave a level out of $wpide_pmpro_price_notes to keep its text as it is; "default" applies to all other levels.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.