Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to check if a member’s email address contains certain words


Boone Gorges
Keymaster

@boonebgorges

Try something like this, Anton:
`function boone_get_current_email() {
global $current_user;
get_currentuserinfo();

if ( strpos( $current_user->user_email, ‘changeme.username@yourdomain.com’ ) !== false ) {
$redirect = ‘whatever your redirect URL is’;
wp_redirect( $redirect );
}
}
add_action( ‘plugins_loaded’, ‘boone_get_current_email’ );`

Totally off the top of my head and untested, but you get the idea. You might have to play with where you hook it (plugins_loaded is just a guess) so that the redirect works properly.

Skip to toolbar