Support » Plugin: Appointment Hour Booking - WordPress Booking Plugin » PHP for default email value

  • Resolved andreasTypo

    (@andreastypo)


    Hi,

    Me again.

    I was thinking about the email field for booking a time slot.
    Is it possible to predefine the field with the logged in user his email address?
    So checking if a user already has an account on a site and using this email address, else leaving it empty.

    
    <?php global $current_user;
    get_currentuserinfo();
    $current_user->user_email;
    ?>
    

    or checking with if state ?

    
    function auto_fill_email() {
    	if ( is_user_logged_in() ) {
            	$current_user->user_email;
    	}
    }
    add_action('init', 'auto_fill_email');
    

    Just thinking out loud đŸ˜‰
    Thanks again!

    Kind regards,
    Andreas

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP for default email value’ is closed to new replies.