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 femiyb/bb850719776a61d825ef590e6928e564 to your computer and use it in GitHub Desktop.
Save femiyb/bb850719776a61d825ef590e6928e564 to your computer and use it in GitHub Desktop.
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