Home › Forums › Ticket Products › Event Tickets Plus › Adding download attendees list front-end get attendees_csv_nonce code
- This topic has 9 replies, 2 voices, and was last updated 9 years ago by
David Hager.
-
AuthorPosts
-
March 6, 2017 at 1:21 am #1249740
David Hager
ParticipantFor a client who finds it really hard to print the attendees list for each of their events I wanted to create a front-end button on each event page where they could directly download the CSV of that event. I thought the only url difference would be the event ID but there is also a attendees_csv_nonce code that looks something like this e0813242c8 is there a way to echo that code on the single event page?
I have created a simple button that has the following URL
<a href="mydomain.com/wp-admin/edit.php?post_type=tribe_events&page=tickets-attendees&event_id=<?php echo $event_id; ?>&attendees_csv=1&attendees_csv_nonce=9d644e8a9c" class="alloy-attendees">
and it directly downloads the CSV to your browser if the event has that specific code , but on the rest of the event is jus goes to the attendees admin page.March 7, 2017 at 3:11 pm #1250799Cliff
MemberHi.
This plugin might help you or your client have an easier time navigating events with tickets in wp-admin.
However, specific to your question:
- The Export button comes from https://github.com/moderntribe/event-tickets/blob/4.4.3/src/Tribe/Attendees_Table.php#L491
- That line’s $export_url comes from https://github.com/moderntribe/event-tickets/blob/4.4.3/src/Tribe/Attendees_Table.php#L465-L470
That should be the answer you need. Let me know if you don’t get it.
If you do get it, please share your full code snippet. It seems like a good customization for others too.
March 8, 2017 at 4:34 am #1250967David Hager
Participant@cliff thanks for the detailed reply. I did some testing and digging around, but my PHP skill level isn’t that great yet and I have no clue how I could get the variable $export_url from your function into my tribe-events/single-event.php. I’ll do some further research on this and when I find a answer I’ll post back here.
March 8, 2017 at 10:49 am #1251248Cliff
MemberAre you doing a Template Override or using an action hook to insert this button onto the Event Single page?
Please share your full code snippet, and I’ll see if I can help further.
March 9, 2017 at 2:31 am #1251631David Hager
ParticipantHey Cliff, I am doing a template overwrite, this is for a some what older site, so I would do a lot of thing already different
This is what I have so far and on line 31 there is a static link with some PHP sprinkled in:
https://gist.github.com/mvaneijgen/dae20f46f63d91f494f7e7b97bf66700March 9, 2017 at 1:55 pm #1252010Cliff
MemberPlease try this replacement:
https://gist.github.com/cliffordp/fbf5c01a5b1b830e4783ef7930181831
March 14, 2017 at 3:41 am #1253712David Hager
ParticipantHey @Cliff thanks this works amazing! I only had to add a .= on line 9 to have the variables stack https://gist.github.com/mvaneijgen/bba90982e7d8dd6e82c4f6fae7d609d7
-
This reply was modified 9 years, 1 month ago by
David Hager.
March 14, 2017 at 11:23 am #1254002Cliff
MemberAh, good catch.
I updated the gist. See after the array() now; it does not need the dot-equals.
I’m glad this worked well for you!
April 5, 2017 at 9:35 am #1265097Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Adding download attendees list front-end get attendees_csv_nonce code’ is closed to new replies.
