Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, this is when creating new event ? if yes, try to modify template file at events-manager/templates/forms/event/when.php

    to use template: http://wp-events-plugin.com/documentation/using-template-files/

    Thread Starter Square Eye

    (@squareeye)

    Thank you Angelo! I can edit it OK now, that’s really helpful. One more question though: The particular bit of the form says this:

    <input id=”start-time” class=”em-time-input em-time-start” type=”text” size=”8″ maxlength=”8″ name=”event_start_time” value=”<?php echo date( $hours_format, $EM_Event->start ); ?>” />

    Now I can’t just empty the value of the input, because then it doesn’t remember the time when I’m editing an event I created previously; I just want to empty it when I’m adding a new one. So I think it’s setting the default value of $EM_Event->start to 12:00AM for new events – where would I find that bit so I can change it to NULL?

    Thank you again.

    caimin_nwl

    (@caimin_nwl)

    What do you want the default time to be?

    Thread Starter Square Eye

    (@squareeye)

    Would like it to be empty if possible – no value at all. Most events we want to add have unknown start & end times – so we want to add them without attaching times to them – but that’s not the same thing as “All day”. At the moment we have to manually delete the default “12:00am” and then save.

    Thanks!

    caimin_nwl

    (@caimin_nwl)

    Ok, then you should be able to leave it blank in the template:

    <input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="event_start_time" value="" />

    The NULL value will be added automatically by Events Manager if there’s no time specified.

    Thread Starter Square Eye

    (@squareeye)

    Thanks – I tried that originally – but isn’t the same form used by the “Edit event” function? i.e. if you enter and save a start & end time, doesn’t it then forget them if you go to edit the event?

    caimin_nwl

    (@caimin_nwl)

    Try this instead. It check for the presence of an event start time, if there’s one there it uses it – if not it’ll be blank.

    <input id="start-time" class="em-time-input em-time-start" type="text" size="8" maxlength="8" name="event_start_time" value="<?php if (EM_Event->start) { echo date( $hours_format, $EM_Event->start );} ?>" />

    Thread Starter Square Eye

    (@squareeye)

    Perfect, thank you! Just a missing $ I think – the following works for me:

    <?php if ($EM_Event->start) { echo date($hours_format, $EM_Event->start);} ?>

    Appreciate the help.

    caimin_nwl

    (@caimin_nwl)

    Yes, you’re right I missed out a $ – good catch 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Leaving times blank’ is closed to new replies.