Created
September 25, 2023 10:54
-
-
Save ipokkel/1ef1f6c25c3d95853de9c04d6071864e to your computer and use it in GitHub Desktop.
Change or translate text strings on the administrative PMPro Members List page.
This file contains 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 | |
/** | |
* Change or translate text for the Members List page. | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_memberslist_text_change( $translated_text, $original_text, $domain ) { | |
global $pagenow; | |
if ( 'paid-memberships-pro' === $domain && 'admin.php' === $pagenow && ! empty( $_REQUEST['page'] ) && 'pmpro-memberslist' === $_REQUEST['page'] ) { | |
switch ( $original_text ) { | |
case 'Never': | |
$translated_text = 'Auto-Renew'; | |
break; | |
} | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'my_pmpro_memberslist_text_change', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment