Hi,
certainly – here it is:
<?php
function bweb_add_custom_event_fields(){
?>
<p>
<label for=’user_company’><?php esc_html_e(‘Firma’, ‘textdomain’); ?></label>
<input type=”text” name=”user_company” id=”user-company” class=”input” value=”<?php if(!empty($_REQUEST[‘user_company’])) echo esc_attr($_REQUEST[‘user_company’]); ?>” />
</p>
<?php
}
add_action(’em_register_form’,’bweb_add_custom_event_fields’);
function bweb_save_custom_event_fields (){
global $EM_Booking ;
if( ! empty( $_REQUEST[‘user_company’] ) ){
$EM_Booking->booking_meta[‘registration’][‘user_company’] = wp_kses( $_REQUEST[‘user_company’], array() );
}
}
add_filter(’em_booking_add’,’bweb_save_custom_event_fields’);
function bweb_table_custom_event_fields($template, $EM_Bookings_Table){
$template[‘user_company’] = __(‘Firma’, ‘textdomain’);
return $template;
}
add_action(’em_bookings_table_cols_template’, ‘bweb_table_custom_event_fields’,10,2);
function bweb_display_col_custom_event_fields($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
if( $col == ‘user_company’ ){
$val = $EM_Booking->get_person()->user_company;
}
return $val;
}
add_filter(’em_bookings_table_rows_col’,’bweb_display_col_custom_event_fields’, 10, 5);
I am using WordPress 4.4.2 and Events Manager 5.6.2
Thanks for your help!
cheers
P.