Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Last active November 17, 2020 13:27
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 MaryOJob/125e6b79ca9eee9e49cd7ebeea88d959 to your computer and use it in GitHub Desktop.
Save MaryOJob/125e6b79ca9eee9e49cd7ebeea88d959 to your computer and use it in GitHub Desktop.
Change the word "State" to "County" for Paid Memberships Pro
<?php
/* This replaces all fields with 'state' with 'county'
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_replace_text_for_pmpro_pages($text) {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['confirmation'] ) || is_page( $pmpro_pages['account'] ) || is_page( $pmpro_pages['billing'] ) || is_page( $pmpro_pages['cancel'] ) || is_page( $pmpro_pages['invoice'] ) || is_page( $pmpro_pages['levels'] ) ) {
$text = str_replace( 'State', 'County', $text) ;
}
return $text;
}
add_filter('the_content', 'my_replace_text_for_pmpro_pages', 25);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment