- This topic has 6 replies, 2 voices, and was last updated 3 years, 1 month ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › How to have only one RSVP/people by defaut
Hi Franky
When I create an event in the backend I can force only one RSVP by Name/e-mail. But when the event is created with EMEFS I don’t know how to set this parameter by default. Have you a solution ?
From the docu:
”
Many newer event options are stored in properties, see eme_events.php function eme_init_event_props(), for a whole list.
A small enumeration:
auto_approve (*)
ignore_pending (*)
all_day (*)
take_attendance (*)
min_allowed
max_allowed
rsvp_end_target
rsvp_discount
rsvp_discountgroup
use_worldpay (*)
use_stripe (*)
use_braintree (*)
use_stripe (*)
”
In your case: the property you’re looking for is “person_only_once” or “email_only_once” (see eme_events.php function eme_init_event_props(), for a whole list).
Thanks, I understand I could modify the eme_init_event_props() by setting the value ’email_only_once’=1. But how to do this properly and not have to do it again at each update.Is it necessary to create a hook or is there an other solution?
No, *never* change the code. That is not what the doc says. But for changing it “by default” (so without asking for it), use the EME filter eme_event_preinsert_filter for this.
The next version of EME will have eme_insert_event_filter (a bit more logical name).
I also created such a filter only for EMEFS (in the version released today): emefs_event_insert_filter
Thanks but I’m reaching my limits in PHP. I know how to add a hook or a filter in functions.php of a child theme. But I don’t know what filter or function to create and how
.
This should do it:
function my_emefs_event_insert_filter($event){
$event['event_properties']['person_only_once'] = 1;
return $event;
}
add_filter('emefs_event_insert_filter','my_emefs_event_insert_filter');
I was afraid to ask. Thank you, Franky, for your great support
Frédéric