Skip to content

Instantly share code, notes, and snippets.

@evrpress
Last active February 27, 2017 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evrpress/9fcdd704fb47bd974299f661e8fb370f to your computer and use it in GitHub Desktop.
Save evrpress/9fcdd704fb47bd974299f661e8fb370f to your computer and use it in GitHub Desktop.
Populates the last name if present in the first name field
add_filter( 'mailster_verify_subscriber', function( $entry ) {
if ( isset( $entry['firstname'] ) ) {
$names = explode( ' ', $entry['firstname'] );
$entry['firstname'] = array_shift( $names );
if ( ! empty( $names ) ) {
$entry['lastname'] = implode( ' ', $names );
}
}
return $entry;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment