Forum Replies Created
-
AuthorPosts
-
Tim
ParticipantThank you very much!
July 5, 2017 at 11:00 am in reply to: How Can I Programmatically Register (RSVP) An Attendee #1316409Tim
ParticipantThanks a lot for the help!
July 4, 2017 at 10:01 pm in reply to: How Can I Programmatically Register (RSVP) An Attendee #1316153Tim
Participant** Only thing I am worried about with the above code is potential updates that would overwrite it as I just have that code stuffed inside the generate_tickets function.
July 4, 2017 at 9:59 pm in reply to: How Can I Programmatically Register (RSVP) An Attendee #1316152Tim
ParticipantThanks for the reply!
How does the generate_tickets() function get called? I see that the RSVP form has a blank action field so the form should just call itself correct? Or does the RSVP under the Tribe directory call the rsvp.php in the view directory.
So essentially what I would need to do is to post the correct variables and then call generate_tickets() which would then trigger the creation of a new attendee?
I think I did solve the problem with the code below (just manually added in the mapping for the ACF fields upon attendee creation), but I would like to know what you mean for future reference as well!
`// Collect Form Info
$first_name[‘value’] = empty($_POST[‘first-name’]) ? ” : $_POST[‘first-name’];
$last_name[‘value’] = empty($_POST[‘last-name’]) ? ” : $_POST[‘last-name’];
$gender[‘value’] = empty($_POST[‘menu-808’]) ? ” : $_POST[‘menu-808’];
$dob[‘value’] = empty($_POST[‘date-300’]) ? ” : $_POST[‘date-300’];
…
inserts post
…// Assign ACF Keys Info
$first_name[‘key’] = “first_name”;
$last_name[‘key’] = “last_name”;
$gender[‘key’] = “gender”;
$dob[‘key’] = “date_of_birth”;// Update Fields
update_field( $first_name[‘key’], $first_name[‘value’], $attendee_id );
update_field( $last_name[‘key’], $last_name[‘value’], $attendee_id );
update_field( $gender[‘key’], $gender[‘value’], $attendee_id );
update_field( $dob[‘key’], $dob[‘value’], $attendee_id ); -
AuthorPosts
