Created
May 18, 2020 15:43
-
-
Save femiyb/0b25b881ab9cbb5900e9561c3e16c189 to your computer and use it in GitHub Desktop.
Change text with str_replace
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_mmpu( $text ) { | |
global $pmpro_pages; | |
if ( is_page( $pmpro_pages['levels'] ) ) { | |
$text = str_replace( 'Membership Selections', 'Selections', $text ); | |
} | |
return $text; | |
} | |
add_filter( 'the_content', 'my_change_text_mmpu', 25 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment