Created
March 12, 2015 21:33
-
-
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
This file contains hidden or 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 | |
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