Support

Home Forums Event Espresso Premium How to add a column to the registrations page on the admin side?

How to add a column to the registrations page on the admin side?

Posted: August 9, 2018 at 2:19 pm

Viewing 3 reply threads


rpsagency

August 9, 2018 at 2:19 pm

Is it possible to add a column to the registrations main page on the admin side? (here: https://pasteboard.co/Hyq8hJG.png)

The client wants us to place a column that contains the custom registration field there that we added to the Personal Information question group. Is that possible? This would allow them see this information at a glance.


Josh

  • Support Staff

August 9, 2018 at 3:38 pm

Hi,

You may need to get a PHP developer involved to help you get this done because the columns in the registration are built using PHP. There’s an example in our code library that shows how to add an additional column via the WordPress plugin API:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/admin/bc_add_custom_column_to_admin_list_table.php


rpsagency

August 10, 2018 at 7:06 pm

Thank you! Working on how to implement this now. Is there an easy way to grab the data from the custom field? Is there a standard format for pulling the custom meta field?


Tony

  • Support Staff

August 11, 2018 at 5:27 am

If you are viewing the registration list table, you’ll be passed an EE_Registration object as the $item for the column.

The item passed will always be for the corresponding row, i.e. if you viewing the Events list table, the item would be the EE_Event object and so on.

So for this:

Is there an easy way to grab the data from the custom field?

Take a look at this example:

https://gist.github.com/Pebblo/88f2a0a9213c716e4886a249e7709245

That snippet does 2 things, it adds a custom registration question column and adds that custom column to the sortable columns.

The section that shows you how to pull the answer to a specific question is here:

https://gist.github.com/Pebblo/88f2a0a9213c716e4886a249e7709245#file-example-php-L25-L38

You’ll need to set the questions ID in the $question_id variable but it sounds like that snippet does pretty much everything you are looking for, it’ll just need some small modifications to suit your use case.

Viewing 3 reply threads

The support post ‘How to add a column to the registrations page on the admin side?’ 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.

Event Espresso