Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change level name and page title for a specific level checkout
<?php
function my_custom_level_cost_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Membership Level':
$translated_text = __( 'My Membership Level Name', 'paid-memberships-pro' );
break;
}
return $translated_text;
}
function my_custom_checkout_text() {
global $pmpro_pages, $pmpro_level;
if ( 22 === intval( $pmpro_level->id ) ) {
add_filter( 'gettext', 'my_custom_level_cost_text', 10, 3 );
?>
<script>
jQuery(document).ready(function () {
jQuery('h1.entry-title').text('My Custom Page Title');
});
</script>
<?php
}
}
add_action( 'wp_head', 'my_custom_checkout_text' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment