So, what I have till now:
function cf7_dynamic_select_field_values ( $hu, $replace ) {
if ( $hu['name'] != 'tuev-termine' )
return $hu;
global $EventPost;
$rows = $EventPost->get_events(
array (
// 'post_type' => 'tuev-termine',
// 'numberposts' => '',
'nb' => '10',
'past' => '0',
'order' => 'ASC'
)
);
if ( ! $rows )
return $hu;
foreach ( $rows as $row ) {
$hu['raw_values'][] = $row->event_begin . ' | ' . $row->event_end;
}
$pipes = new WPCF7_Pipes($hu['raw_values']);
$hu['values'] = $pipes->collect_befores();
$hu['labels'] = $pipes->collect_afters();
$hu['pipes'] = $pipes;
return $hu;
}
add_filter( 'wpcf7_form_tag', 'cf7_dynamic_select_field_values', 10, 2);
This works fine except one thing:
- Time format output is XXXX-XX-XX XX:XX:XX which I would like to have XX.XX.XXXX (only full day events!)
I tried to format the output, but without success till now.
Any help would be great – thank you.
Regards
Glad you’ve found!
thank you for using Eventpost