Forked from MaryOJob/my_pmpro_replace_mail_emailandusername.php
Last active
December 8, 2020 07:55
-
-
Save ipokkel/2a9400ade6d44d474f7feb1a01d43f92 to your computer and use it in GitHub Desktop.
Replace "Email Address" with "Username or Email Address" on PMPro Login Form
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 | |
/** | |
* This recipe will search your codebase for | |
* translatable strings and replace when an exact match is found. | |
* | |
* 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 register_text( $translating ) { | |
// Bail if on password reset page | |
if ( | |
( isset( $_REQUEST['action'] ) && ! empty( $_REQUEST['action'] ) ) || | |
( isset( $_REQUEST['checkemail'] ) && ! empty( $_REQUEST['checkemail'] ) ) ) { | |
return $translating; | |
} | |
//Replace "Email Address" with "Username or Email Address" on PMPro Login Form | |
$translated = str_ireplace( 'Email Address', 'Username or Email Address', $translating ); | |
return $translated; | |
} | |
add_filter( 'gettext', 'register_text' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment