-
-
Save MaryOJob/0eb923668b62e664b7749a90c2b0a087 to your computer and use it in GitHub Desktop.
Change text with str_replace on the Gift Levels PMPro Add-On
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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