Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 13, 2018 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/abfbfb34dbb1019c37f96e31a1330e9d to your computer and use it in GitHub Desktop.
Save joshfeck/abfbfb34dbb1019c37f96e31a1330e9d to your computer and use it in GitHub Desktop.
Bump the default start and end dates for Event Espresso 4's datetimes to this month
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_test_get_dtt_edit_row_args( $template_args, $dttrow, $dtt, $default, $all_dtts, $creating_event ) {
if ( $template_args['DTT_ID'] == 0 ) {
$template_args['DTT_EVT_start'] = date('Y-m-d h:i a');
$end = time() + HOUR_IN_SECONDS;
$template_args['DTT_EVT_end'] = date('Y-m-d h:i a', $end);
}
return $template_args;
}
add_filter( 'FHEE__espresso_events_Pricing_Hooks___get_dtt_edit_row__template_args', 'ee_test_get_dtt_edit_row_args', 10, 6 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment