Posted: June 28, 2016 at 4:19 am
|
Hello, Is there any possibility to include the event authors in the registrations csv download? I use that field to indicate the instructors for each training, and I use the csv for all the course reporting.. Therefore this feature would be very useful to me. |
Yes, you can use the |
|
|
thanks Josh. As you know, I’m not a developer, so what do I have to do exactly to enable this? |
Usually the best thing to do is hire a developer if you need customizations done. |
|
|
Is this a difficult customization? I don’t want to hire a developer who will take 4 hours to learn how EE4 works for a 5 minute customization π Thanks for your perspective. |
Using the filter isn’t terribly difficult because it was designed to allow for altering the array of data that gets passed to the CSV report generator. |
|
|
is it possible to do it without touching the core EE4 files, so that I can continue to get the new versions? |
|
if it is just a few lines of code, I would really appreciate your help here π |
Yes it’s possible (and recommended) to make this customization without touching the core files. There’s some example code that shows how to add a column that adds the venue to the CSV report in this gist. Maybe you can adapt the code to get the author of the event. |
|
|
thanks, that would help if I knew php, but unfortunately I have no idea how to modify this code to replace venue with author π |
Here are a few resources that will help you get the author name: http://wordpress.stackexchange.com/a/191288 https://codex.wordpress.org/Function_Reference/get_userdata#Examples |
|
|
I gave it a shot with my non existent PHP knowledge, could you check and correct if needed?
|
This needs to be corrected because the $post_id variable isn’t set:
You do have the
This conditional will likely do nothing since there’s no EE_Post_Author:
So you remove that and replace with some code to get the author name. This is the part where you can use the examples from the above linked codex article. If you want the name to be displayed as Last Name, First Name; the code will look something like this:
|
|
|
Ok thank you for your inputs. I have changed to code to the below, would that work?
|
Of course! |
|
|
That worked! Thanks:) I’m also wondering if it’s possible to add the Event Tags to the download with a similar code? |
It’d be different code, but you’d use the same I can recommend looking through the code examples in the WordPress codex for the get_the_tags() function. That’s the function that gets the event’s tags. |
|
The support post ‘Include event author in the registrations csv download’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.