Hi Guys,
I have a custom post type called ‘submissions’ where it has the following fields:
- Post Title
- Custom Field: user_id
- Custom Field: teacher
- Custom Field: sorness
As it is, the form is setup to show only the soreness input field where ‘user_id’ and ‘teacher’ custom fields are hidden, however, I would like to populate these (user_id, teacher) with current data from the logged in user.
The custom field ‘user_id’ would be $current_user->ID and teacher would be another stored variable.
I assume this would be set inside ‘new_post’ array? Can somebody please help?
<?php
acf_form(array(
'post_id' => 'new_post',
'post_title' => false,
'post_content' => false,
'fields' => array(
'soreness'
),
'new_post' => array(
'post_type' => 'submissions',
'post_status' => 'publish',
'post_title' => $current_user->user_login,
),
'submit_value' => 'Send'
));
?>
Cheers
Tim