Support

Home Forums Event Espresso Premium People Admin Addon: how do I save multiple select type

People Admin Addon: how do I save multiple select type

Posted: February 3, 2020 at 8:15 pm

Viewing 2 reply threads


eschwarz

February 3, 2020 at 8:15 pm

I need to be able to save multiple people for each type.

I updated the select statement in the template:

<select multiple name="people_to_cpt[<?php echo $people_type->get('term_taxonomy_id'); ?>][PER_ID]" id="people-to-cpt-<?php echo $people_type->get('term_taxonomy_id'); ?>">

When I select more than one on that field, it’s only saving one value in the db table.

In the function people_to_event_updates I loop through the array of values:

foreach ( $data['people_to_cpt'] as $type_id => $people_values ) { }

The problem is that the value $data[‘people_to_cpt’] is an array with only 1 value, when I dump the value, I get…

[people_to_cpt] => Array
(
[10] => Array
(
[PER_ID] => 167
)
)

It’s giving me id 167, but I selected two values. What do I need to update to allow it to pass multiple values?


eschwarz

February 3, 2020 at 8:31 pm

I wanted to add that this is tied to an event. So I add a new event and I want to assign multiple organizers to that event. I added a type using the people addon labeled “organizer”. The field is fine and I’m able to select multiple people, but these are not saving as I explained in the previous post. Thanks in advance for any help you can give me.


Josh

  • Support Staff

February 4, 2020 at 8:04 am

Hi,

Those should save without making edits to the code. For example:

Can you revert any code changes to the plugin(s) then try again? If it still doesn’t save all choices then maybe there’s a plugin/theme conflict. Then you can troubleshoot by temporarily deactivating the other plugins & temporarily switching to a default “twenty*” theme.

Viewing 2 reply threads

The support post ‘People Admin Addon: how do I save multiple select type’ 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