v 3.7.2 released
This commit is contained in:
parent
50fb63f53c
commit
067ec3cb1d
|
@ -56,6 +56,10 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
|
|||
'id' => 'email_setting_sec',
|
||||
'title' => '<i class="fas fa-envelope"></i>'.__('Email Settings', 'mage-eventpress')
|
||||
),
|
||||
array(
|
||||
'id' => 'datetime_setting_sec',
|
||||
'title' => '<i class="fas fa-envelope"></i>'.__('Date & Time Format Settings', 'mage-eventpress')
|
||||
),
|
||||
array(
|
||||
'id' => 'style_setting_sec',
|
||||
'title' => '<i class="fas fa-palette"></i>'.__('Style Settings', 'mage-eventpress')
|
||||
|
@ -183,16 +187,16 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
|
|||
'type' => 'text',
|
||||
'default' => ''
|
||||
),
|
||||
array(
|
||||
'name' => 'mep_event_time_format',
|
||||
'label' => __('Event Time Format', 'mage-eventpress'),
|
||||
'desc' => __('Please select what format time you want to display in the event front-end.', 'mage-eventpress'),
|
||||
'type' => 'select',
|
||||
'default' => 'wtss',
|
||||
'options' => array(
|
||||
'wtss' => 'WordPress TimeStamp Settings'
|
||||
)
|
||||
),
|
||||
// array(
|
||||
// 'name' => 'mep_event_time_format',
|
||||
// 'label' => __('Event Time Format', 'mage-eventpress'),
|
||||
// 'desc' => __('Please select what format time you want to display in the event front-end.', 'mage-eventpress'),
|
||||
// 'type' => 'select',
|
||||
// 'default' => 'wtss',
|
||||
// 'options' => array(
|
||||
// 'wtss' => 'WordPress TimeStamp Settings'
|
||||
// )
|
||||
// ),
|
||||
array(
|
||||
'name' => 'mep_event_expire_on_datetimes',
|
||||
'label' => __('When will the event expire', 'mage-eventpress'),
|
||||
|
@ -481,6 +485,7 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
|
|||
),
|
||||
)
|
||||
),
|
||||
|
||||
'email_setting_sec' => apply_filters('mep_settings_email_arr', array(
|
||||
array(
|
||||
'name' => 'mep_email_sending_order_status',
|
||||
|
@ -1030,7 +1035,69 @@ if (!class_exists('MAGE_Events_Setting_Controls')) :
|
|||
|
||||
)
|
||||
|
||||
),
|
||||
|
||||
'datetime_setting_sec' => apply_filters('mep_settings_datetime_arr', array(
|
||||
|
||||
array(
|
||||
'name' => 'mep_global_date_format',
|
||||
'label' => __('Date Format', 'mage-eventpress'),
|
||||
'desc' => __('Please select the date format from the list, If you want to use any custom date format then select the Custom and write your custom date format. This Date format will only apply in all the events', 'mage-eventpress'),
|
||||
'type' => 'select',
|
||||
'default' => get_option('date_format'),
|
||||
'class' => 'mep_global_date_format',
|
||||
'options' => mep_date_format_list()
|
||||
),
|
||||
array(
|
||||
'name' => 'mep_global_custom_date_format',
|
||||
'label' => __('Custom Date Format', 'mage-eventpress'),
|
||||
'desc' => __('<a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank">Documentation on date and time formatting</a>', 'mage-eventpress'),
|
||||
'type' => 'text',
|
||||
'default' => 'F j, Y'
|
||||
),
|
||||
array(
|
||||
'name' => 'mep_global_time_format',
|
||||
'label' => __('Time Format', 'mage-eventpress'),
|
||||
'desc' => __('Please select the time format from the list, If you want to use any custom time format then select the Custom and write your custom time format. This time format will only apply in all the events.', 'mage-eventpress'),
|
||||
'type' => 'select',
|
||||
'class' => 'mep_global_time_format',
|
||||
'default' => get_option('time_format'),
|
||||
'options' => mep_time_format_list()
|
||||
),
|
||||
array(
|
||||
'name' => 'mep_global_custom_time_format',
|
||||
'label' => __('Custom Time Format', 'mage-eventpress'),
|
||||
'desc' => __('<a href="https://wordpress.org/support/article/formatting-date-and-time/" target="_blank">Documentation on date and time formatting</a>', 'mage-eventpress'),
|
||||
'type' => 'text',
|
||||
'default' => 'g:i a'
|
||||
),
|
||||
array(
|
||||
'name' => 'mep_global_timezone_display',
|
||||
'label' => __('Show Timezone', 'mage-eventpress'),
|
||||
'desc' => __('If you want to show the timezone with the date and time please clect yes.', 'mage-eventpress'),
|
||||
'type' => 'select',
|
||||
'default' => 'no',
|
||||
'options' => array(
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No'
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
||||
return apply_filters('mep_settings_sec_fields', $settings_fields);
|
||||
|
|
|
@ -283,7 +283,7 @@ class MAGE_Setting_API {
|
|||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$html = sprintf( '<select class="%1$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
|
||||
$html = sprintf( '<select class="%1$s %3$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
|
||||
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $value, $key, false ), $label );
|
||||
|
|
|
@ -929,7 +929,7 @@ class MP_Event_All_Info_In_One
|
|||
$reg_checked = 'checked';
|
||||
}
|
||||
?>
|
||||
<!-- <tr>
|
||||
<tr>
|
||||
<th title="<?php esc_html_e('Event SKU No:', 'mage-eventpress'); ?>"><span><?php esc_html_e('SKU No:', 'mage-eventpress'); ?></span></th>
|
||||
<td colspan="3">
|
||||
<label>
|
||||
|
@ -938,7 +938,7 @@ class MP_Event_All_Info_In_One
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<!--tr>
|
||||
<th><span><?php esc_html_e('Registration On/Off:', 'mage-eventpress'); ?></span></th>
|
||||
<td colspan="3">
|
||||
<label>
|
||||
|
@ -1361,6 +1361,7 @@ function mep_event_meta_save($post_id)
|
|||
|
||||
|
||||
$mep_reg_status = isset($_POST['mep_reg_status']) ? sanitize_text_field($_POST['mep_reg_status']) : 'off';
|
||||
$mep_enable_custom_dt_format = isset($_POST['mep_enable_custom_dt_format']) ? sanitize_text_field($_POST['mep_enable_custom_dt_format']) : 'off';
|
||||
$mep_show_end_datetime = isset($_POST['mep_show_end_datetime']) ? sanitize_text_field($_POST['mep_show_end_datetime']) : 'no';
|
||||
$mep_reset_status = isset($_POST['mep_reset_status']) ? sanitize_text_field($_POST['mep_reset_status']) : 'off';
|
||||
$mep_available_seat = isset($_POST['mep_available_seat']) ? sanitize_text_field($_POST['mep_available_seat']) : 'off';
|
||||
|
@ -1374,10 +1375,44 @@ function mep_event_meta_save($post_id)
|
|||
mep_reset_event_booking($post_id);
|
||||
}
|
||||
|
||||
|
||||
$date_format_arr = mep_date_format_list();
|
||||
$time_format_arr = mep_time_format_list();
|
||||
|
||||
$current_global_date_format = mep_get_option('mep_global_date_format','datetime_setting_sec',$date_format);
|
||||
$current_global_time_format = mep_get_option('mep_global_time_format','datetime_setting_sec',$time_format);
|
||||
|
||||
$current_global_custom_date_format = mep_get_option('mep_global_custom_date_format','datetime_setting_sec',$date_format);
|
||||
$current_global_custom_time_format = mep_get_option('mep_global_custom_time_format','datetime_setting_sec',$time_format);
|
||||
|
||||
$current_global_timezone_display = mep_get_option('mep_global_timezone_display','datetime_setting_sec','no');
|
||||
|
||||
|
||||
$mep_event_date_format = isset($_POST['mep_event_date_format']) ? sanitize_text_field($_POST['mep_event_date_format']) : $current_global_date_format;
|
||||
|
||||
$mep_event_time_format = isset($_POST['mep_event_time_format']) ? sanitize_text_field($_POST['mep_event_time_format']) : $current_global_time_format;
|
||||
|
||||
$mep_event_custom_date_format = isset($_POST['mep_event_custom_date_format']) ? sanitize_text_field($_POST['mep_event_custom_date_format']) : $current_global_custom_date_format;
|
||||
|
||||
$mep_custom_event_time_format = isset($_POST['mep_custom_event_time_format']) ? sanitize_text_field($_POST['mep_custom_event_time_format']) : $current_global_custom_time_format;
|
||||
|
||||
$mep_time_zone_display = isset($_POST['mep_time_zone_display']) ? sanitize_text_field($_POST['mep_time_zone_display']) : $current_global_timezone_display;
|
||||
|
||||
if($mep_reg_status == 'on'){
|
||||
update_post_meta($post_id, 'mep_event_date_format', $mep_event_date_format);
|
||||
update_post_meta($post_id, 'mep_event_time_format', $mep_event_time_format);
|
||||
update_post_meta($post_id, 'mep_event_custom_date_format', $mep_event_custom_date_format);
|
||||
update_post_meta($post_id, 'mep_custom_event_time_format', $mep_custom_event_time_format);
|
||||
update_post_meta($post_id, 'mep_time_zone_display', $mep_time_zone_display);
|
||||
}
|
||||
|
||||
|
||||
|
||||
update_post_meta($post_id, 'mep_show_end_datetime', $mep_show_end_datetime);
|
||||
update_post_meta($post_id, 'mep_rich_text_status', $mep_rich_text_status);
|
||||
update_post_meta($post_id, 'mep_available_seat', $mep_available_seat);
|
||||
update_post_meta($post_id, 'mep_reg_status', $mep_reg_status);
|
||||
update_post_meta($post_id, 'mep_enable_custom_dt_format', $mep_enable_custom_dt_format);
|
||||
update_post_meta($post_id, '_tax_status', $_tax_status);
|
||||
update_post_meta($post_id, '_tax_class', $_tax_class);
|
||||
|
||||
|
|
|
@ -281,6 +281,7 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value
|
|||
$start_time = get_post_meta($eid, 'event_start_time', true);
|
||||
$location_text = mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress')) ? mep_get_option('mep_location_text', 'label_setting_sec', esc_html__('Location', 'mage-eventpress')) : 'Location';
|
||||
$date_text = mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress')) ? mep_get_option('mep_event_date_text', 'label_setting_sec', esc_html__('Date', 'mage-eventpress')) : 'Date';
|
||||
|
||||
if (get_post_type($eid) == 'mep_events') {
|
||||
$event_id = $eid;
|
||||
$mep_events_extra_prices = array_key_exists('event_extra_option', $values) ? $values['event_extra_option'] : [];
|
||||
|
@ -294,16 +295,16 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value
|
|||
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
|
||||
$time_status = get_post_meta($eid, 'mep_disable_ticket_time', true) ? get_post_meta($eid, 'mep_disable_ticket_time', true) : 'no';
|
||||
|
||||
$name_lable = get_post_meta($event_id, 'mep_name_label', true) ? get_post_meta($event_id, 'mep_name_label', true) : esc_html__('Name', 'mage-eventpress');
|
||||
$email_lable = get_post_meta($event_id, 'mep_email_label', true) ? get_post_meta($event_id, 'mep_email_label', true) : esc_html__('Email', 'mage-eventpress');
|
||||
$phone_lable = get_post_meta($event_id, 'mep_phone_label', true) ? get_post_meta($event_id, 'mep_phone_label', true) : esc_html__('Phone', 'mage-eventpress');
|
||||
$address_lable = get_post_meta($event_id, 'mep_address_label', true) ? get_post_meta($event_id, 'mep_address_label', true) : esc_html__('Address', 'mage-eventpress');
|
||||
$tshirt_lable = get_post_meta($event_id, 'mep_tshirt_label', true) ? get_post_meta($event_id, 'mep_tshirt_label', true) : esc_html__('T-Shirt Size', 'mage-eventpress');
|
||||
$gender_lable = get_post_meta($event_id, 'mep_gender_label', true) ? get_post_meta($event_id, 'mep_gender_label', true) : esc_html__('Gender', 'mage-eventpress');
|
||||
$company_lable = get_post_meta($event_id, 'mep_company_label', true) ? get_post_meta($event_id, 'mep_company_label', true) : esc_html__('Company', 'mage-eventpress');
|
||||
$desg_lable = get_post_meta($event_id, 'mep_desg_label', true) ? get_post_meta($event_id, 'mep_desg_label', true) : esc_html__('Designation', 'mage-eventpress');
|
||||
$website_lable = get_post_meta($event_id, 'mep_website_label', true) ? get_post_meta($event_id, 'mep_website_label', true) : esc_html__('Website', 'mage-eventpress');
|
||||
$veg_lable = get_post_meta($event_id, 'mep_veg_label', true) ? get_post_meta($event_id, 'mep_veg_label', true) : esc_html__('Vegetarian', 'mage-eventpress');
|
||||
$name_lable = get_post_meta($event_id, 'mep_name_label', true) ? get_post_meta($event_id, 'mep_name_label', true) : esc_html__('Name', 'mage-eventpress');
|
||||
$email_lable = get_post_meta($event_id, 'mep_email_label', true) ? get_post_meta($event_id, 'mep_email_label', true) : esc_html__('Email', 'mage-eventpress');
|
||||
$phone_lable = get_post_meta($event_id, 'mep_phone_label', true) ? get_post_meta($event_id, 'mep_phone_label', true) : esc_html__('Phone', 'mage-eventpress');
|
||||
$address_lable = get_post_meta($event_id, 'mep_address_label', true) ? get_post_meta($event_id, 'mep_address_label', true) : esc_html__('Address', 'mage-eventpress');
|
||||
$tshirt_lable = get_post_meta($event_id, 'mep_tshirt_label', true) ? get_post_meta($event_id, 'mep_tshirt_label', true) : esc_html__('T-Shirt Size', 'mage-eventpress');
|
||||
$gender_lable = get_post_meta($event_id, 'mep_gender_label', true) ? get_post_meta($event_id, 'mep_gender_label', true) : esc_html__('Gender', 'mage-eventpress');
|
||||
$company_lable = get_post_meta($event_id, 'mep_company_label', true) ? get_post_meta($event_id, 'mep_company_label', true) : esc_html__('Company', 'mage-eventpress');
|
||||
$desg_lable = get_post_meta($event_id, 'mep_desg_label', true) ? get_post_meta($event_id, 'mep_desg_label', true) : esc_html__('Designation', 'mage-eventpress');
|
||||
$website_lable = get_post_meta($event_id, 'mep_website_label', true) ? get_post_meta($event_id, 'mep_website_label', true) : esc_html__('Website', 'mage-eventpress');
|
||||
$veg_lable = get_post_meta($event_id, 'mep_veg_label', true) ? get_post_meta($event_id, 'mep_veg_label', true) : esc_html__('Vegetarian', 'mage-eventpress');
|
||||
|
||||
|
||||
if ($recurring == 'everyday' && $time_status == 'no') {
|
||||
|
|
|
@ -2502,9 +2502,16 @@ if (!function_exists('mep_event_total_seat')) {
|
|||
|
||||
if (!function_exists('get_mep_datetime')) {
|
||||
function get_mep_datetime($date, $type) {
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
$wpdatesettings = $date_format . ' ' . $time_format;
|
||||
$event_id = get_the_id() ? get_the_id() : 0;
|
||||
// $date_format = get_option('date_format');
|
||||
$date_format = mep_get_datetime_format($event_id,'date');
|
||||
$date_format_timezone = mep_get_datetime_format($event_id,'date_timezone');
|
||||
// $time_format = get_option('time_format');
|
||||
$time_format = mep_get_datetime_format($event_id,'time');
|
||||
$time_format_timezone = mep_get_datetime_format($event_id,'time_timezone');
|
||||
|
||||
|
||||
$wpdatesettings = $date_format . ' ' . $time_format_timezone;
|
||||
$timezone = wp_timezone_string();
|
||||
$timestamp = strtotime($date . ' ' . $timezone);
|
||||
|
||||
|
@ -2523,7 +2530,7 @@ if (!function_exists('get_mep_datetime')) {
|
|||
return esc_html(wp_date($wpdatesettings, $timestamp, wp_timezone()));
|
||||
}
|
||||
if ($type == 'time') {
|
||||
return esc_html(wp_date($time_format, $timestamp, wp_timezone()));
|
||||
return esc_html(wp_date($time_format_timezone, $timestamp, wp_timezone()));
|
||||
}
|
||||
|
||||
if ($type == 'Hour') {
|
||||
|
@ -4798,7 +4805,7 @@ function mep_event_shortcode_info($post_id){
|
|||
$reg_checked = 'checked';
|
||||
}
|
||||
} else {
|
||||
$reg_checked = 'checked';
|
||||
$reg_checked = 'checked';
|
||||
}
|
||||
// echo $reg_checked;
|
||||
?>
|
||||
|
@ -4819,23 +4826,9 @@ function mep_event_shortcode_info($post_id){
|
|||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
<?php if($reg_checked != 'checked'){ ?>
|
||||
jQuery(".mep_ticket_type_setting_sec").hide(200);
|
||||
jQuery(".mep_ticket_type_setting_sec").hide(200);
|
||||
<?php } ?>
|
||||
|
||||
// jQuery(".mp_event_ticket_type_des_switch").click(function() {
|
||||
// if(jQuery(this).is(":checked")) {
|
||||
// jQuery(".mep_ticket_type_setting_sec").show(300);
|
||||
// } else {
|
||||
// jQuery(".mep_ticket_type_setting_sec").hide(200);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// });
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -4870,11 +4863,291 @@ function mep_event_pro_purchase_notice(){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function mep_get_datetime_format($event_id=0,$type='date'){
|
||||
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
$current_date_format = mep_get_option('mep_global_date_format','datetime_setting_sec',$date_format);
|
||||
$current_time_format = mep_get_option('mep_global_time_format','datetime_setting_sec',$time_format);
|
||||
$current_global_custom_date_format = mep_get_option('mep_global_custom_date_format','datetime_setting_sec',$date_format);
|
||||
$current_global_custom_time_format = mep_get_option('mep_global_custom_time_format','datetime_setting_sec',$time_format);
|
||||
|
||||
$current_global_timezone_display = mep_get_option('mep_global_timezone_display','datetime_setting_sec','no');
|
||||
|
||||
$saved_date_format = get_post_meta($event_id,'mep_event_date_format',true) ? get_post_meta($event_id,'mep_event_date_format',true) : $current_date_format;
|
||||
$saved_custom_date_format = get_post_meta($event_id,'mep_event_custom_date_format',true) ? get_post_meta($event_id,'mep_event_custom_date_format',true) : $current_global_custom_date_format;
|
||||
$saved_time_format = get_post_meta($event_id,'mep_event_time_format',true) ? get_post_meta($event_id,'mep_event_time_format',true) : $current_time_format;
|
||||
$saved_custom_time_format = get_post_meta($event_id,'mep_custom_event_time_format',true) ? get_post_meta($event_id,'mep_custom_event_time_format',true) : $current_global_custom_time_format;
|
||||
|
||||
$saved_time_zone_display = get_post_meta($event_id,'mep_time_zone_display',true) ? get_post_meta($event_id,'mep_time_zone_display',true) : $current_global_timezone_display;
|
||||
|
||||
|
||||
|
||||
|
||||
$date_format = $saved_date_format == 'custom' ? $saved_custom_date_format : $saved_date_format;
|
||||
$time_format = $saved_time_format == 'custom' ? $saved_custom_time_format : $saved_time_format;
|
||||
$timezone = $saved_time_zone_display == 'yes' ? ' T' : '';
|
||||
|
||||
|
||||
|
||||
if($type == 'date'){
|
||||
return $date_format;
|
||||
}elseif($type == 'date_timezone'){
|
||||
return $date_format.$timezone;
|
||||
}elseif($type == 'time'){
|
||||
return $time_format;
|
||||
}elseif($type == 'time_timezone'){
|
||||
return $time_format.$timezone;
|
||||
}
|
||||
else{
|
||||
return $date_format;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add_action('mp_event_recurring_every_day_setting','mep_event_recurring_purchase_notice',90);
|
||||
function mep_event_recurring_purchase_notice(){
|
||||
$event_id = get_the_id();
|
||||
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Event');
|
||||
|
||||
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
|
||||
$date_format_arr = mep_date_format_list();
|
||||
$time_format_arr = mep_time_format_list();
|
||||
|
||||
$current_date_format = mep_get_option('mep_global_date_format','datetime_setting_sec',$date_format);
|
||||
$current_time_format = mep_get_option('mep_global_time_format','datetime_setting_sec',$time_format);
|
||||
|
||||
$current_global_custom_date_format = mep_get_option('mep_global_custom_date_format','datetime_setting_sec',$date_format);
|
||||
$current_global_custom_time_format = mep_get_option('mep_global_custom_time_format','datetime_setting_sec',$time_format);
|
||||
|
||||
$current_global_timezone_display = mep_get_option('mep_global_timezone_display','datetime_setting_sec','no');
|
||||
|
||||
$saved_date_format = get_post_meta($event_id,'mep_event_date_format',true) ? get_post_meta($event_id,'mep_event_date_format',true) : $current_date_format;
|
||||
|
||||
$saved_custom_date_format = get_post_meta($event_id,'mep_event_custom_date_format',true) ? get_post_meta($event_id,'mep_event_custom_date_format',true) : $current_global_custom_date_format;
|
||||
|
||||
$saved_time_format = get_post_meta($event_id,'mep_event_time_format',true) ? get_post_meta($event_id,'mep_event_time_format',true) : $current_time_format;
|
||||
|
||||
$saved_custom_time_format = get_post_meta($event_id,'mep_custom_event_time_format',true) ? get_post_meta($event_id,'mep_custom_event_time_format',true) : $current_global_custom_time_format;
|
||||
|
||||
$saved_time_zone_display = get_post_meta($event_id,'mep_time_zone_display',true) ? get_post_meta($event_id,'mep_time_zone_display',true) : $current_global_timezone_display;
|
||||
|
||||
|
||||
$values = get_post_custom($event_id);
|
||||
|
||||
$mep_enable_custom_dt_format = '';
|
||||
if (array_key_exists('mep_enable_custom_dt_format', $values)) {
|
||||
if ($values['mep_enable_custom_dt_format'][0] == 'on') {
|
||||
$mep_enable_custom_dt_format = 'checked';
|
||||
}
|
||||
} else {
|
||||
$mep_enable_custom_dt_format = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<ul>
|
||||
<li><h3><?php esc_html_e('Enable Custom DateTime Format for this '.$event_label.' (Off/On):', 'mage-eventpress'); ?></h3><hr /></li>
|
||||
<li>
|
||||
<label class='mep_enable_custom_dt_format'>
|
||||
<input class="mp_opacity_zero " type="checkbox" name="mep_enable_custom_dt_format" <?php echo esc_attr($mep_enable_custom_dt_format); ?> /><span class="slider round"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
<?php if($mep_enable_custom_dt_format != 'checked'){ ?>
|
||||
jQuery(".mep_custom_timezone_setting").hide(200);
|
||||
<?php } ?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div class='mep_custom_timezone_setting'>
|
||||
<!-- <h3><?php esc_html_e(' Date & TIme Format For this '.$event_label.': ', 'mage-eventpress'); ?></h3> -->
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
|
||||
<tr class='mep_global_date_format'>
|
||||
<th scope="row"><?php _e('Date Format','mage-eventpress'); ?></th>
|
||||
<td>
|
||||
<select class="regular mep_global_date_format" name="mep_event_date_format" id="datetime_setting_sec[mep_global_date_format]">
|
||||
<?php
|
||||
foreach($date_format_arr as $key => $date){ ?>
|
||||
<option value='<?php echo $key;?>' <?php if($saved_date_format == $key){ echo 'Selected'; } ?>><?php echo $date;?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<p class='event_meta_help_txt'>
|
||||
<?php _e('Please select the date format from the list, If you want to use any custom date format then select the Custom and write your custom date format. This Date format will only apply in all the events','mage-eventpress'); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="mep_global_custom_date_format" style="">
|
||||
<th scope="row"><label for="datetime_setting_sec[mep_global_custom_date_format]"><?php _e('Custom Date Format','mage-eventpress'); ?></label></th>
|
||||
<td>
|
||||
<input type="text" class="regular-text" id="datetime_setting_sec[mep_global_custom_date_format]" name="mep_event_custom_date_format" value="<?php echo $saved_custom_date_format; ?>">
|
||||
<p class="event_meta_help_txt">
|
||||
<a href="https://wordpress.org/support/article/formatting-date-and-time/">Documentation on date and time formatting</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="mep_global_time_format">
|
||||
<th scope="row"><label for="datetime_setting_sec[mep_global_time_format]"><?php _e('Time Format','mage-eventpress'); ?></label></th>
|
||||
<td>
|
||||
<select class="regular mep_global_time_format" name="mep_event_time_format" id="datetime_setting_sec[mep_global_time_format]">
|
||||
<?php
|
||||
foreach($time_format_arr as $key => $date){ ?>
|
||||
<option value='<?php echo $key;?>' <?php if($saved_time_format == $key){ echo 'Selected'; } ?>><?php echo $date;?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<p class="event_meta_help_txt">
|
||||
<?php _e('Please select the time format from the list, If you want to use any custom time format then select the Custom and write your custom time format. This time format will only apply in all the events.','mage-eventpress'); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="mep_global_custom_time_format">
|
||||
<th scope="row"><label for="datetime_setting_sec[mep_global_custom_time_format]"><?php _e('Custom Time Format','mage-eventpress'); ?></label></th>
|
||||
<td>
|
||||
<input type="text" class="regular-text" id="datetime_setting_sec[mep_global_custom_time_format]" name="mep_custom_event_time_format" value="<?php echo $saved_custom_time_format; ?>">
|
||||
<p class="event_meta_help_txt">
|
||||
<a href="https://wordpress.org/support/article/formatting-date-and-time/">Documentation on date and time formatting</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr class="mep_global_timezone_display">
|
||||
<th scope="row"><label for="datetime_setting_sec[mep_global_timezone_display]"><?php _e('Show Timezone','mage-eventpress'); ?></label></th>
|
||||
<td>
|
||||
<select class="regular mep_global_timezone_display" name="mep_time_zone_display" id="datetime_setting_sec[mep_global_timezone_display]">
|
||||
<option value="yes" <?php if($saved_time_zone_display == 'yes'){ echo 'Selected'; } ?>><?php _e('Yes','mage-eventpress'); ?></option>
|
||||
<option value="no" <?php if($saved_time_zone_display == 'no'){ echo 'Selected'; } ?>><?php _e('No','mage-eventpress'); ?></option>
|
||||
</select>
|
||||
<p class="event_meta_help_txt">
|
||||
<?php _e('If you want to show the timezone with the date and time please sclect yes.','mage-eventpress'); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
if(!mep_check_plugin_installed('woocommerce-event-manager-addon-recurring-event/recurring_events.php') ) {
|
||||
?>
|
||||
<p class="event_meta_help_txtx"><span class="dashicons dashicons-info"></span> <?php _e("Looking for Recurring events function where customer can choose date and time check out our <a href='https://mage-people.com/product/recurring-events-addon-for-event-manager/' target='_blank'>Recurring Addon</a>", 'mage-eventpress'); ?></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function mep_date_format_list(){
|
||||
$format = [
|
||||
'F j, Y' => date('F j, Y'),
|
||||
'j F, Y' => date('j F, Y'),
|
||||
'D, F j, Y' => date('D, F j, Y'),
|
||||
'l, F j, Y' => date('l, F j, Y'),
|
||||
'Y-m-d' => date('Y-m-d'),
|
||||
'm/d/Y' => date('m/d/Y'),
|
||||
'd/m/Y' => date('d/m/Y'),
|
||||
'custom' => __('Custom Date Format','mage-eventpress'),
|
||||
];
|
||||
return $format;
|
||||
}
|
||||
|
||||
function mep_time_format_list(){
|
||||
$format = [
|
||||
'g:i a' => date('g:i a'),
|
||||
'g:i A' => date('g:i A'),
|
||||
'H:i' => date('H:i'),
|
||||
'H\H i\m\i\n' => date('H\H i\m\i\n'),
|
||||
'custom' => __('Custom Time Format','mage-eventpress'),
|
||||
];
|
||||
return $format;
|
||||
}
|
||||
|
||||
add_action('admin_footer','mep_admin_footer_js');
|
||||
function mep_admin_footer_js(){
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
$current_date_format = mep_get_option('mep_global_date_format','datetime_setting_sec',$date_format);
|
||||
$current_time_format = mep_get_option('mep_global_time_format','datetime_setting_sec',$time_format);
|
||||
?>
|
||||
<script>
|
||||
|
||||
<?php
|
||||
if($current_date_format == 'custom'){
|
||||
?>
|
||||
jQuery(".mep_global_custom_date_format").slideDown(200);
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
jQuery(".mep_global_custom_date_format").slideUp(200);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if($current_time_format == 'custom'){
|
||||
?>
|
||||
jQuery(".mep_global_custom_time_format").slideDown(200);
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
jQuery(".mep_global_custom_time_format").slideUp(200);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
jQuery(document).on('change', '.mep_global_date_format', function () {
|
||||
if (jQuery(this).val() != '' && jQuery(this).val() == 'custom') {
|
||||
jQuery(".mep_global_custom_date_format").slideDown(200);
|
||||
} else {
|
||||
jQuery(".mep_global_custom_date_format").slideUp(200);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
jQuery(document).on('change', '.mep_global_time_format', function () {
|
||||
if (jQuery(this).val() != '' && jQuery(this).val() == 'custom') {
|
||||
jQuery(".mep_global_custom_time_format").slideDown(200);
|
||||
} else {
|
||||
jQuery(".mep_global_custom_time_format").slideUp(200);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
|
@ -31,6 +31,8 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).on('click', 'label.mp_event_ticket_type_des_switch input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').slideDown(200);
|
||||
|
@ -41,6 +43,16 @@
|
|||
}
|
||||
});
|
||||
|
||||
$(document).on('click', 'label.mep_enable_custom_dt_format input', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').slideDown(200);
|
||||
$(".mep_custom_timezone_setting").slideDown(200);
|
||||
} else {
|
||||
// $(this).parents('label.mp_event_ticket_type_des_switch').siblings('label.mep_ticket_type_setting_sec').val('').slideUp(200);
|
||||
$(".mep_custom_timezone_setting").slideUp(200);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce
|
||||
* Plugin URI: http://mage-people.com
|
||||
* Description: A Complete Event Solution for WordPress by MagePeople..
|
||||
* Version: 3.7.1
|
||||
* Version: 3.7.2
|
||||
* Author: MagePeople Team
|
||||
* Author URI: http://www.mage-people.com/
|
||||
* Text Domain: mage-eventpress
|
||||
|
|
Loading…
Reference in New Issue