Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save propertyhive/1172c62a78f0012c4aca5fe5c6b94571 to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/1172c62a78f0012c4aca5fe5c6b94571 to your computer and use it in GitHub Desktop.
add_filter( 'propertyhive_reapit_foundations_enquiry_body', 'split_name_in_reapit_enquiry', 10, 1 );
function split_name_in_reapit_enquiry($body)
{
if ( isset($_POST['first_name']) && !empty($_POST['first_name']) )
{
$body['forename'] = sanitize_text_field($_POST['first_name']);
}
if ( isset($_POST['last_name']) && !empty($_POST['last_name']) )
{
$body['surname'] = sanitize_text_field($_POST['last_name']);
}
return $body;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment