Posted: January 19, 2017 at 9:17 am
|
I’m trying to customize the file EED_Espresso_Calendar.module.php from the Calendar plugin within my child theme. However, I don’t know where to place the custom file inside the child theme and make it work, so that I don’t have problems later when the plugin updates. |
You can’t load a custom version of the file. Can I ask what you have changed? we may be able to include some additional hooks that allow you to do what you need within the calendar. |
|
|
My events have recurring dates, so inside the calendar they appear in different dates. I need each event get linked to its corresponding event page for that particular date. Check screenshot https://postimg.org/image/ea0zqvp0p/. |
There is no event page for each date to link to, so I’m not sure what you are doing? Can you provide further details please, the screenshot doesn’t really help unfortunately. |
|
|
I send you private details to calendar. |
I responded to your message but will also add it here. The events are linking back to the same event page however you are passing a variable within the query string, a ‘session’ id. I can create a feature request for a filter within the calendar that can be used to alter the links, we can pas the current datetime to the filer which should allow you to pull the session id you need although it depends where/how that id is being stored. So would a filter with access to the datetime object work for you? |
|
|
Thanks for your response. session id is store in the wp_esp_datetime table, as DTT_ID. Check screenshot https://postimg.org/image/o6qwlfkjx/. Your solutions sounds good to me, but you should consider that any active event may appear in the calendar as many different times as different date times are created for that event. Would your filter solution enable this functionality? |
That happens by default so I’m not sure what you need? Event with multiple datetimes – http://take.ms/YDB7v How it appears on the calendar by default – http://take.ms/zueO6
In that case, yes a filter with the datetime object passed to it will work. |
|
|
Yes Tony, it comes by default, however, events in the calendar do not link to the event page with a particular date time, as I showed you in my website, but to a common event page for all events displaying the first and last date times. Therefore I need to link each event in the calendar to its particular date time page, for which I think the filter would be a good solution. Could you please send me indications for the hook? |
Your events don’t link to a new page per event, they link to exactly the same page that EE does, the difference being your passing a variable along within the query string to only display specific tickets. Its still the same ‘common event page’ link just with an additional value at the end, the filter will handle that just fine.
I’ve created a feature request ticket to include this in the next version of the calendar and also pushed the code for the filter, this will be reviewed by the core dev team and if no issue found with the changes, tested by the support team before being included within the add-on. I can provide details of the hook once it has been reviewed by the dev team so just waiting on feedback from them. |
|
|
Thanks Tony! I look forward to having the hook. |
|
Hi Tony, any further progress on the review of hook by your dev team? Thanks |
Yes, it’s currently in a branch and ready for testing. |
|
|
Hello there, any update on the hook you had ready for testing? I’m really in need of this. Thanks |
Hi Javier, I emailed you a copy of the calendar for testing. You can try it out with this function: function tw_tooltip_permalink( $permalink, $event, $datetime ) { if( $datetime instanceof EE_Datetime_In_Calendar ) { $datetime = $datetime->datetime(); } $permalink .= '#testing-dt-id-' . $datetime->ID() . '-event-id-' . $event->ID(); return $permalink; } add_filter('FHEE__EE_Calendar__tooltip_event_permalink', 'tw_tooltip_permalink', 10, 3 ); add_filter('FHEE__EE_Datetime_In_Calendar__to_array_for_json__url', 'tw_tooltip_permalink', 10, 3 ); Note that you’ll need an updated copy of the calendar for using the function above. — |
|
|
Thank you for your great support and code. This has worked for me. |
I’m glad the above worked for you. The branch you are using will be merged into the main branch and released with the next update to the Calendar. |
|
The support post ‘Where to place custom file from Calendar plugin inside my Child Theme?’ 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.