Skip to content

Instantly share code, notes, and snippets.

@bappi-d-great
Created March 12, 2015 21:33
Show Gist options
  • Save bappi-d-great/87b01184d3f7b8f7e2e9 to your computer and use it in GitHub Desktop.
Save bappi-d-great/87b01184d3f7b8f7e2e9 to your computer and use it in GitHub Desktop.
WPMU A+ use default name and email when profile meta field is empty and booking created by the admin
<?php
add_filter( 'app-appointment-inline_edit-save_data', 'app_inline_save_cb' );
function app_inline_save_cb( $data ){
$user = get_userdata( $data['user'] );
if ( username_exists( $user->user_login ) ){
$data['email'] = $data['email'] == '' ? $user->user_email : $data['email'];
$data['name'] = $data['name'] == '' ? $user->display_name : $data['name'];
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment