Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Forked from femiyb/my_change_text_mmpu.php
Last active May 20, 2020 13:17
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 MaryOJob/0eb923668b62e664b7749a90c2b0a087 to your computer and use it in GitHub Desktop.
Save MaryOJob/0eb923668b62e664b7749a90c2b0a087 to your computer and use it in GitHub Desktop.
Change text with str_replace on the Gift Levels PMPro Add-On
<?php
/*
Replace or translate text strings that's not translatable with gettext.
*/
// Check page content and replace text strings
function my_change_text_gift_addon( $text ) {
global $pmpro_pages;
if ( is_page( $pmpro_pages['account'] ) || is_page( $pmpro_pages['confirmation'] ) ) {
$text = str_replace( 'Gift Codes', 'Códigos de Regalo', $text );
$text = str_replace( 'Share this link with your gift recipient', 'Comparte este enlace con tu destinatario del regalo', $text );
}
return $text;
}
add_filter( 'the_content', 'my_change_text_gift_addon', 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment