[php]
//Populate Gravity Form with
add_filter( ‚gform_pre_render_16‘, ‚bflow_populate_event_dates‘ );
function bflow_populate_event_dates( $form ) {
global $post;
// Add Custom Post Field Dates in array
$dates = array();
for ($i = 0; $i < 3; $i++ ) {
$field_name = 'termin_' . $i;
$dates[$i] = get_field($field_name);
}
//Creating item array.
$items = array();
foreach ( $dates as $date ) {
$items[] = array( 'value' => $date, ‚text‘ => $date );
}
//Adding items to field id 5.
foreach ( $form[‚fields‘] as &$field ) {
if ( $field->id == 5 ) {
$field->choices = $items;
}
}
return $form;
}
[/php]
Related Articles
- Gravity Forms Placeholder Styling
- Grafity Forms Export Seperator ändern
- GF Returns & Tabstops entfernen
- Datum Format von Gravity Forms in PDF Ausgabe ändern
- Populate Gravity Form from Database
- Gravity Forms Bestellübersicht/Pre Order
- Fix Elementor fixed Background sizing
- Cronjob Überlappung verhindern – flock()
- WordPress Update Hinweise deaktivieren
- WP Download Manager "attached file is missing/deleted" Fehler