Skip to content

Instantly share code, notes, and snippets.

@femiyb
Created May 18, 2020 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save femiyb/0b25b881ab9cbb5900e9561c3e16c189 to your computer and use it in GitHub Desktop.
Save femiyb/0b25b881ab9cbb5900e9561c3e16c189 to your computer and use it in GitHub Desktop.
Change text with str_replace
<?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