Im working on a WordPress-site where a reservationform is installed. I want the name of the logged on user is the defaultvalue in the "name" textfield since only loggen on users can make reservations. The php-code which builds the form looks like this (originial):
// Contact details fieldset
'contact' => array(
'legend' => __( 'Contact Details', 'restaurant-reservations' ),
'fields' => array(
'name' => array(
'title' => __( 'Firmenname', 'restaurant-reservations' ),
'request_input' => empty( $request->name ) ? '***VALUE***' : $request->name,
'callback' => 'rtb_print_form_text_field',
'required' => true,
),
This continues with other value like Mail and Phonenumber.
I need to get the value from the $user_login - variable printed in the textfield. I tried entering the variable itself, declare it, extending a string and tried to execute php-code. But nothing of this works out.
Is there any other way for printing out the variable in a textfield?
Please dont mind asking futher questions as i cant explain it that detailed.
Greets