funmusic
Forum Replies Created
-
Yes, this code was on functions.php. Thanks, the filters are a possibility if there is one for each events manager option. I also discover the functions add_option and update_option from the wordpress api that can are a bit better than doing the query myself.
Thanks. I guess that doesn’t modify the wp_options content. It is a possibility but there are other options I want to modify (like the format of the header of the events), that can’t be achieved that way.
Maybe it is an option to do directly sql queries on activation of our custom plugin. I just wanted to do it the way it is supposed to be done.
By the way, if the code I posted is correct (even if it doesn’t work for unknown reasons) I’ll mark the question as resolved.
Yes, thanks for your help.
I think I can’t use the wp-admin options to change the event format, because I need to modify the event link as shown in:
<a href=\"#_EVENTURL?cid={$post->ID}\">I am passing a GET parameter cid (where did the user come from), because I am using this info on the booking page. And I don’t have that parameter on the wordpress admin page.
Ok, thanks, but what about showing only events in the future? It is not that important because the calendar shows the current day in other color, but should the above code work?, because it doesn’t for me.
Yes, that was the problem. If the user cancels the booking from the frontend the mail gets sent.
Yes, and the owner receives only the mail when the event gets booked for the first time.
Hi, with that code, the calendar shows future, present and past events. I don’t know how to filter events that are booked. It is a bit wierd that by default the calendar shows fully booked events. If there isn’t an option to filter that on the output function or on the calendar shortcode, maybe should I filter that events on the full-calendar.php template not inserting them on $cell_events array?
I’ll put again the code, because it got broken on my first post:
echo EM_Events::output($cell_events,array('scope'=>'future', 'format'=>"<li><a href=\"#_EVENTURL?cid={$post->ID}\">#_24HSTARTTIME</a></li>"));I have taken a look at how the hooks mentioned work. Even if the function save says it gets executed even if the booking exists, it looks that em_booking_save (the hook that is inside function save()) doesn’t get executed on booking update.
But em_booking_set_status gets executed, and it does after saving to the database, so it is exactly what I needed. For the pre hook, I still don’t know what can I use, but I think for now the wpnonce is enough security. I’ll mark this as resolved but everyone is welcome to make further clarifications.
I think that could help to disallow the cancellation. For the information I need to update I’ll see if em_booking_save works, I want to make sure the data is on the database before putting my data to it. Thanks to both.
I believe I am using em_booking_save_pre and em_booking_save. I did this a while back and I didn’t remember that the hook was on save, not on creation. Now looking at the comments on the save function, maybe this is also what I need for the cancel, because upon cancelling a booking, the booking object would also have to be written to the database.