Small fix for empty end dates
-
Thanks for a wonderful plugin. It’s well written and documented, and makes a great base for customization.
I ran into the following issue, and have a solution that others may find helpful. If an author forgets to either check “single day post” or enter an end date, the end date defaults to the post date, and nothing shows up. Similarly, if the author accidentally posts an end date that’s before the start date, nothing shows up. This can be confusing.
I opened up core\gg-post-type.php, and added the following code beginning at 197 (after the closing brace, of course):
else{ if($events_meta['gg_event_date_end_standard_format']< $events_meta['gg_event_date_start_standard_format']){ $events_meta['gg_event_date_end_standard_format'] = $events_meta['gg_event_date_start_standard_format']; }
All this does is to set the date_end field to the date_start field if the end date is blank or before the beginning – thus defaulting to a single date event.
So far it seems to be a worthwhile hack, but let me know if you can see any problems with it.
- The topic ‘Small fix for empty end dates’ is closed to new replies.