Hi Kevin,
Business hours needs to stored in specific format in database, otherwise it will not work as expected.
Ex: https://github.com/AyeCode/geodirectory/blob/master/includes/admin/dummy-data/standard_places.php#L188
https://github.com/AyeCode/geodirectory/blob/master/includes/admin/dummy-data/standard_places.php#L842
Try following PHP snippet to use normal text input for business hours.
function gd_snippet_190802_cfi_business_hours( $html, $cf ) {
$label = __( $cf['frontend_title'], 'geodirectory' );
$description = __( $cf['desc'], 'geodirectory' );
$value = geodir_get_cf_value( $cf );
if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
$validation = ' pattern="'.$cf['validation_pattern'].'" ';
}else{$validation='';}
// validation message
if(isset($cf['validation_msg']) && $cf['validation_msg']){
$validation_msg = 'title="'.$cf['validation_msg'].'"';
}else{$validation_msg='';}
if ( ! empty( $value ) ) {
$value = stripslashes_deep( $value );
}
ob_start();
?>
<div id="<?php echo $cf['name'];?>_row"
class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
<label for="<?php echo esc_attr( $cf['name'] ); ?>"> <?php echo $label; ?> <?php if ($cf['is_required']) echo '<span>*</span>';?>
</label>
<input field_type="text" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" placeholder="<?php echo esc_attr( '["Mo 09:00-17:00","Tu 09:00-17:00","We 09:00-17:00"],["UTC":"+0"]' ); ?>" value="<?php echo esc_attr( $value ); ?>" type="text" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
<span class="geodir_message_note"><?php echo $description; ?></span>
<?php if ($cf['is_required']) { ?>
<span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
<?php } ?>
</div>
<?php
$html = ob_get_clean();
return $html;
}
add_filter( 'geodir_custom_field_input_business_hours', 'gd_snippet_190802_cfi_business_hours', 20, 2 );
Kiran