Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.