Adding download attendees list front-end get attendees_csv_nonce code

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.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1249740
    David Hager
    Participant

    For 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.

    #1250799
    Cliff
    Member

    Hi.

    This plugin might help you or your client have an easier time navigating events with tickets in wp-admin.

    However, specific to your question:

    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.

    #1250967
    David 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.

    #1251248
    Cliff
    Member

    Are 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.

    #1251631
    David Hager
    Participant

    Hey 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/dae20f46f63d91f494f7e7b97bf66700

    #1252010
    Cliff
    Member
    #1253712
    David Hager
    Participant

    Hey @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.
    #1254002
    Cliff
    Member

    Ah, 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!

    #1265097
    Support Droid
    Keymaster

    Hey 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

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Adding download attendees list front-end get attendees_csv_nonce code’ is closed to new replies.