Hi,
Thank you for all that information!
I have both showing up in the submission form now, but they don’t show up in the Front End calendar.
Do I need to set something else in the interface to get those to show?
(Like something in the EventOn display?)
I’m sure I’m just missing a step – thanks for the help!!!
Here is my code:
add_filter(‘evoau_form_fields’, ‘evoautest_fields_to_form’, 10, 1);
function evoautest_fields_to_form($array){
$array[‘evoalcoholfree’]=array(‘Alcohol Free’, ‘evoalcoholfree’, ‘evoalcoholfree’,’custom’,”);
$array[‘evofamilyfriendly’]=array(‘Family Friendly’, ‘evofamilyfriendly’, ‘evofamilyfriendly’,’custom’,”);
return $array;
}
// actionUser integration
add_action(‘evoau_frontform_evoalcoholfree’, ‘evoaualcoholfree_fields’, 10, 6);
// Frontend showing fields and saving values
function evoaualcoholfree_fields($field, $event_id, $default_val, $EPMV, $opt2, $lang){
$helper = new evo_helper();
echo “<div class=’row evoalcoholfree’><p>”;
$evoau_alcoholfree_value = ($EPMV && !empty($EPMV[‘evoau_alcoholfree_value’]) && $EPMV[‘evoau_alcoholfree_value’][0]==’yes’)? true: false;
echo $helper->html_yesnobtn(array(
‘id’=>’evoau_alcoholfree_value’,
‘input’=>true,
‘label’=>evo_lang_get(‘evoAULalcoholfree_1’, ‘Alcohol Free’, $lang, $opt2),
‘var’=> ($evoau_alcoholfree_value?’yes’:’no’),
‘lang’=>$lang,
‘afterstatement’=>’evoau_alcoholfree_value_section’
));
echo “</p></div>”;
}
add_action(‘evoau_frontform_evofamilyfriendly’, ‘evoaufamilyfriendly_fields’, 10, 6);
// Frontend showing fields and saving values
function evoaufamilyfriendly_fields($field, $event_id, $default_val, $EPMV, $opt2, $lang){
$helper = new evo_helper();
echo “<div class=’row evofamilyfriendly’><p>”;
$evoau_familyfriendly_value = ($EPMV && !empty($EPMV[‘evoau_familyfriendly_value’]) && $EPMV[‘evoau_familyfriendly_value’][0]==’yes’)? true: false;
echo $helper->html_yesnobtn(array(
‘id’=>’evoau_familyfriendly_value’,
‘input’=>true,
‘label’=>evo_lang_get(‘evoAULfamilyfriendly_1’, ‘Family Friendly’, $lang, $opt2),
‘var’=> ($evoau_familyfriendly_value?’yes’:’no’),
‘lang’=>$lang,
‘afterstatement’=>’evoau_familyfriendly_value_section’
));
echo “</p></div>”;
}
// save the values to event post meta
add_action(‘evoau_save_formfields’, ‘evoautest_save_values’, 10, 3);
function evoautest_save_values($field, $fn, $created_event_id){
if( $field ==’evoalcoholfree’){
// for each above fields
foreach(array(
‘evoau_alcoholfree_value’,
) as $field){
if(!empty($_POST[$field]))
add_post_meta($created_event_id, $field, $_POST[$field]);
}
}
if( $field ==’evofamilyfriendly’){
// for each above fields
foreach(array(
‘evoau_familyfriendly_value’,
) as $field){
if(!empty($_POST[$field]))
add_post_meta($created_event_id, $field, $_POST[$field]);
}
}
}