file update

This commit is contained in:
magepeopleteam 2020-12-14 12:10:30 +00:00
parent cd939c2829
commit 51e101be13
4 changed files with 1168 additions and 1362 deletions

View File

@ -153,7 +153,7 @@ a.button.remove-faq-row {
display: inline-block; display: inline-block;
width: 60px; width: 60px;
height: 24px; height: 24px;
float: right; margin: -5px 0 0 20px;
} }
.post-type-mep_events .switch input {display: none;} .post-type-mep_events .switch input {display: none;}
@ -335,6 +335,36 @@ div#mep_event_list_thumbnail_meta_boxes table td input#enable_global_qty {
float: left; float: left;
order:2; order:2;
} }
.wrap.mage_settings_panel_wrap {
display: block;
overflow: hidden;
position: relative;
display: -webkit-flex;display: flex;-webkit-flex-wrap: wrap;flex-wrap: wrap;
}
.wrap.mage_settings_panel_wrap h2.nav-tab-wrapper {
width: 20%;
padding: 0;
margin: 0;
float: left;
order:2;
}
.mp_tab_item .item .content input {
display: block;
width: 100%;
border: 1px solid #333;
border-radius: 0;
margin: 10px 0;
padding: 10px;
}
.mp_tab_item .item .content textarea {
width: 100%;
margin: 10px 0;
border-radius: 0;
padding: 10px;
min-height: 200px;
}
#wp-mep_event_cc_email_text-media-buttons button{width:auto !important;}
.wrap.mage_settings_panel_wrap #setting-error-tgmpa{order: 0;width: 100%;} .wrap.mage_settings_panel_wrap #setting-error-tgmpa{order: 0;width: 100%;}
#mp_event_all_info_in_tab table.form-table{table-layout: inherit;} #mp_event_all_info_in_tab table.form-table{table-layout: inherit;}
#mp_event_all_info_in_tab table.form-table th{width: 35%;} #mp_event_all_info_in_tab table.form-table th{width: 35%;}

View File

@ -113,6 +113,117 @@ function mep_fw_meta_boxs()
$events_faq_boxs = array(
'page_nav' => __('Event FAQ', 'mage-eventpress'),
'priority' => 10,
'sections' => array(
'section_2' => array(
'title' => __('', 'mage-eventpress'),
'description' => __('', 'mage-eventpress'),
'options' => array(
array(
'id' => 'mep_event_faq',
'title' => __('F.A.Q Details', 'mage-eventpress'),
'details' => __('', 'mage-eventpress'),
'collapsible' => true,
'type' => 'repeatable',
'btn_text' => 'Add New F.A.Q',
'title_field' => 'mep_faq_title',
'fields' => array(
array(
'type' => 'text',
'default' => '',
'item_id' => 'mep_faq_title',
'name' => 'Title'
),
array(
'type' => 'textarea',
'default' => '',
'item_id' => 'mep_faq_content',
'name' => 'Content'
),
),
),
)
),
),
);
$events_faq_meta_args = array(
'meta_box_id' => 'mep_event_faq_meta_boxes',
'meta_box_title' => '<span class="dashicons dashicons-info"></span>&nbsp;&nbsp;'.__('F.A.Q', 'mage-eventpress'),
'screen' => array('mep_events'),
'context' => 'normal',
'priority' => 'high',
'callback_args' => array(),
'nav_position' => 'none',
'item_name' => "MagePeople",
'item_version' => "2.0",
'panels' => array(
'events_faq_meta_boxs' => $events_faq_boxs
)
);
new AddMetaBox($events_faq_meta_args);
$events_dd_boxs = array(
'page_nav' => __('Event Daywise Details', 'mage-eventpress'),
'priority' => 10,
'sections' => array(
'section_2' => array(
'title' => __('', 'mage-eventpress'),
'description' => __('', 'mage-eventpress'),
'options' => array(
array(
'id' => 'mep_event_day',
'title' => __('Daywise Details', 'mage-eventpress'),
'details' => __('', 'mage-eventpress'),
'collapsible' => true,
'type' => 'repeatable',
'btn_text' => 'Add New Days',
'title_field' => 'mep_day_title',
'fields' => array(
array(
'type' => 'text',
'default' => '',
'item_id' => 'mep_day_title',
'name' => 'Title'
),
array(
'type' => 'textarea',
'default' => '',
'item_id' => 'mep_day_content',
'name' => 'Content'
),
),
),
)
),
),
);
$events_dd_meta_args = array(
'meta_box_id' => 'mep_event_dd_meta_boxes',
'meta_box_title' => '<span class="dashicons dashicons-analytics"></span>&nbsp;&nbsp;'.__('Daywise Details', 'mage-eventpress'),
'screen' => array('mep_events'),
'context' => 'normal',
'priority' => 'high',
'callback_args' => array(),
'nav_position' => 'none',
'item_name' => "MagePeople",
'item_version' => "2.0",
'panels' => array(
'events_dd_meta_boxs' => $events_dd_boxs
)
);
new AddMetaBox($events_dd_meta_args);
@ -201,7 +312,6 @@ function mep_fw_meta_boxs()
'speakers_meta_boxs' => $email_body_meta_boxs 'speakers_meta_boxs' => $email_body_meta_boxs
), ),
); );
new AddMetaBox( $email_body_meta_args ); new AddMetaBox( $email_body_meta_args );

View File

@ -2,23 +2,26 @@
if (!defined('ABSPATH')) { if (!defined('ABSPATH')) {
die; die;
} // Cannot access pages directly. } // Cannot access pages directly.
class MP_Event_All_Info_In_One { class MP_Event_All_Info_In_One
public function __construct() { {
public function __construct()
{
add_action('add_meta_boxes', array($this, 'mp_event_all_info_in_tab')); add_action('add_meta_boxes', array($this, 'mp_event_all_info_in_tab'));
} }
public function mp_event_all_info_in_tab() { public function mp_event_all_info_in_tab()
{
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
add_meta_box('mp_event_all_info_in_tab', __('<span class="dashicons dashicons-info"></span>' . $event_label . ' Information : ', 'mage-eventpress') . get_the_title(get_the_id()), array($this, 'mp_event_all_in_tab'), 'mep_events', 'normal', 'high'); add_meta_box('mp_event_all_info_in_tab', __('<span class="dashicons dashicons-info"></span>' . $event_label . ' Information : ', 'mage-eventpress') . get_the_title(get_the_id()), array($this, 'mp_event_all_in_tab'), 'mep_events', 'normal', 'high');
add_meta_box('mep-event-template', __('Template', 'mage-eventpress'), array($this, 'mep_event_template_meta_box_cb'), 'mep_events', 'side', 'low'); add_meta_box('mep-event-template', __('Template', 'mage-eventpress'), array($this, 'mep_event_template_meta_box_cb'), 'mep_events', 'side', 'low');
} }
public function mp_event_all_in_tab() { public function mp_event_all_in_tab()
{
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
$post_id = get_the_id(); $post_id = get_the_id();
?> ?>
<div class="mp_event_all_meta_in_tab"> <div class="mp_event_all_meta_in_tab mp_event_tab_area">
<div class="mp_tab_menu"> <div class="mp_tab_menu">
<ul> <ul>
<?php do_action('mep_admin_event_details_before_tab_name_location', $post_id); ?> <?php do_action('mep_admin_event_details_before_tab_name_location', $post_id); ?>
@ -34,14 +37,7 @@ class MP_Event_All_Info_In_One {
<span class="dashicons dashicons-calendar-alt"></span>&nbsp;&nbsp;<?php _e('Date & Time', 'mage-eventpress'); ?> <span class="dashicons dashicons-calendar-alt"></span>&nbsp;&nbsp;<?php _e('Date & Time', 'mage-eventpress'); ?>
</li> </li>
<?php do_action('mep_admin_event_details_before_tab_name_date_time', $post_id); ?> <?php do_action('mep_admin_event_details_before_tab_name_date_time', $post_id); ?>
<li data-target-tabs="#mp_event_faq">
<span class="dashicons dashicons-info"></span>&nbsp;&nbsp;<?php _e( 'F.A.Q', 'mage-eventpress' ); ?>
</li>
<?php do_action( 'mep_admin_event_details_before_tab_name_faq',$post_id ); ?>
<li data-target-tabs="#mp_event_day_wise_details">
<span class="dashicons dashicons-analytics"></span>&nbsp;&nbsp;<?php _e( 'Day wise Details', 'mage-eventpress' ); ?>
</li>
<?php do_action( 'mep_admin_event_details_before_tab_name_day_details',$post_id ); ?>
<li data-target-tabs="#mp_event_settings"> <li data-target-tabs="#mp_event_settings">
<span class="dashicons dashicons-admin-generic"></span>&nbsp;&nbsp;<?php _e('Settings', 'mage-eventpress'); ?> <span class="dashicons dashicons-admin-generic"></span>&nbsp;&nbsp;<?php _e('Settings', 'mage-eventpress'); ?>
</li> </li>
@ -72,7 +68,8 @@ class MP_Event_All_Info_In_One {
<div class="mp_tab_details"> <div class="mp_tab_details">
<?php do_action('mep_admin_event_details_before_tab_details_location', $post_id); ?> <?php do_action('mep_admin_event_details_before_tab_details_location', $post_id); ?>
<div class="mp_tab_item active" data-tab-item="#mp_event_venue"> <div class="mp_tab_item active" data-tab-item="#mp_event_venue">
<h3><?php echo $event_label; _e( ' Location :', 'mage-eventpress' ); ?></h3> <h3><?php echo $event_label;
_e(' Location :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mp_event_venue($post_id); ?> <?php $this->mp_event_venue($post_id); ?>
</div> </div>
@ -81,39 +78,30 @@ class MP_Event_All_Info_In_One {
<h3><?php _e('Ticket Type List :', 'mage-eventpress'); ?></h3> <h3><?php _e('Ticket Type List :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mep_event_ticket_type($post_id); ?> <?php $this->mep_event_ticket_type($post_id); ?>
<h3><?php _e('Extra service Area :', 'mage-eventpress'); ?></h3> <h3><?php _e('Extra service Area :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mep_event_extra_price_option($post_id); ?> <?php $this->mep_event_extra_price_option($post_id); ?>
</div> </div>
<?php do_action('mep_admin_event_details_after_tab_details_ticket_type', $post_id); ?> <?php do_action('mep_admin_event_details_after_tab_details_ticket_type', $post_id); ?>
<div class="mp_tab_item" data-tab-item="#mp_event_time"> <div class="mp_tab_item" data-tab-item="#mp_event_time">
<h3><?php echo $event_label; _e( ' Date & TIme :', 'mage-eventpress' ); ?></h3> <h3><?php echo $event_label;
_e(' Date & TIme :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mep_event_date_meta_box_cb($post_id); ?> <?php $this->mep_event_date_meta_box_cb($post_id); ?>
<?php do_action('mp_event_recurring_every_day_setting', $post_id); ?> <?php do_action('mp_event_recurring_every_day_setting', $post_id); ?>
</div> </div>
<?php do_action('mep_admin_event_details_after_tab_details_date_time', $post_id); ?> <?php do_action('mep_admin_event_details_after_tab_details_date_time', $post_id); ?>
<div class="mp_tab_item" data-tab-item="#mp_event_faq">
<h3><?php echo $event_label; _e( ' F.A.Q :', 'mage-eventpress' ); ?></h3>
<hr/>
<?php $this->mep_event_faq_meta_box_cb( $post_id ); ?>
</div>
<?php do_action( 'mep_admin_event_details_after_tab_details_faq',$post_id ); ?>
<div class="mp_tab_item" data-tab-item="#mp_event_day_wise_details">
<h3><?php echo $event_label; _e( ' Daywise Details :', 'mage-eventpress' ); ?></h3>
<hr/>
<?php $this->mep_event_day_details_cb( $post_id ); ?>
</div>
<?php do_action( 'mep_admin_event_details_after_tab_details_day_details',$post_id ); ?>
<div class="mp_tab_item" data-tab-item="#mp_event_rich_text"> <div class="mp_tab_item" data-tab-item="#mp_event_rich_text">
<h3><?php echo $event_label; _e( ' Rich Texts for SEO & Google Schema Text :', 'mage-eventpress' ); ?></h3> <h3><?php echo $event_label;
_e(' Rich Texts for SEO & Google Schema Text :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mp_event_rich_text($post_id); ?> <?php $this->mp_event_rich_text($post_id); ?>
</div> </div>
<?php do_action('mep_admin_event_details_after_tab_details_rich_text', $post_id); ?> <?php do_action('mep_admin_event_details_after_tab_details_rich_text', $post_id); ?>
<div class="mp_tab_item" data-tab-item="#mp_event_settings"> <div class="mp_tab_item" data-tab-item="#mp_event_settings">
<h3><?php echo $event_label; _e( ' Settings :', 'mage-eventpress' ); ?></h3> <h3><?php echo $event_label;
_e(' Settings :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mp_event_settings($post_id); ?> <?php $this->mp_event_settings($post_id); ?>
</div> </div>
@ -121,7 +109,8 @@ class MP_Event_All_Info_In_One {
<?php if (get_option('woocommerce_calc_taxes') == 'yes') { ?> <?php if (get_option('woocommerce_calc_taxes') == 'yes') { ?>
<div class="mp_tab_item" data-tab-item="#mp_event_tax_settings"> <div class="mp_tab_item" data-tab-item="#mp_event_tax_settings">
<h3><?php echo $event_label; _e( ' Tax Settings :', 'mage-eventpress' ); ?></h3> <h3><?php echo $event_label;
_e(' Tax Settings :', 'mage-eventpress'); ?></h3>
<hr /> <hr />
<?php $this->mp_event_tax($post_id); ?> <?php $this->mp_event_tax($post_id); ?>
</div> </div>
@ -135,14 +124,14 @@ class MP_Event_All_Info_In_One {
</div> </div>
<?php <?php
} }
?> do_action('mep_admin_event_details_end_of_tab_details', $post_id); ?>
<?php do_action( 'mep_admin_event_details_end_of_tab_details',$post_id ); ?>
</div> </div>
</div> </div>
<?php <?php
} }
public function mp_event_venue( $post_id ) { public function mp_event_venue($post_id)
{
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
$values = get_post_custom($post_id); $values = get_post_custom($post_id);
$user_api = mep_get_option('google-map-api', 'general_setting_sec', ''); $user_api = mep_get_option('google-map-api', 'general_setting_sec', '');
@ -152,11 +141,13 @@ class MP_Event_All_Info_In_One {
?> ?>
<table> <table>
<tr> <tr>
<th><?php echo $event_label; _e( " Location Source:", "mage-eventpress" ); ?></th> <th><?php echo $event_label;
_e(" Location Source:", "mage-eventpress"); ?></th>
<td colspan="3"> <td colspan="3">
<label> <label>
<select class="mp_formControl" name="mep_org_address"> <select class="mp_formControl" name="mep_org_address">
<option value="0" <?php echo ( $mep_org_address == 0 ) ? 'selected' : ''; ?>><?php echo $event_label; _e( ' Details', 'mage-eventpress' ); ?></option> <option value="0" <?php echo ($mep_org_address == 0) ? 'selected' : ''; ?>><?php echo $event_label;
_e(' Details', 'mage-eventpress'); ?></option>
<option value="1" <?php echo ($mep_org_address == 1) ? 'selected' : ''; ?>><?php _e('Organizer', 'mage-eventpress'); ?></option> <option value="1" <?php echo ($mep_org_address == 1) ? 'selected' : ''; ?>><?php _e('Organizer', 'mage-eventpress'); ?></option>
</select> </select>
</label> </label>
@ -166,22 +157,19 @@ class MP_Event_All_Info_In_One {
</td> </td>
</tr> </tr>
</table> </table>
<div class="mp_event_address"> <div class="mp_event_address">
<table> <table>
<tr> <tr>
<th><?php _e('Location/Venue:', 'mage-eventpress'); ?></th> <th><?php _e('Location/Venue:', 'mage-eventpress'); ?></th>
<td> <td>
<label> <label>
<input type="text" name='mep_location_venue' placeholder="Ex: New york Meeting Center" class="mp_formControl" <input type="text" name='mep_location_venue' placeholder="Ex: New york Meeting Center" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_location_venue'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_location_venue' ); ?>'>
</label> </label>
</td> </td>
<th><span><?php _e('Street:', 'mage-eventpress'); ?></span></th> <th><span><?php _e('Street:', 'mage-eventpress'); ?></span></th>
<td> <td>
<label> <label>
<input type="text" name='mep_street' placeholder="Ex: 10 E 33rd St" class="mp_formControl" <input type="text" name='mep_street' placeholder="Ex: 10 E 33rd St" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_street'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_street' ); ?>'>
</label> </label>
</td> </td>
</tr> </tr>
@ -189,15 +177,13 @@ class MP_Event_All_Info_In_One {
<th><span><?php _e('City: ', 'mage-eventpress'); ?></span></th> <th><span><?php _e('City: ', 'mage-eventpress'); ?></span></th>
<td> <td>
<label> <label>
<input type="text" name='mep_city' placeholder="Ex: New York" class="mp_formControl" <input type="text" name='mep_city' placeholder="Ex: New York" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_city'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_city' ); ?>'>
</label> </label>
</td> </td>
<th><span><?php _e('State: ', 'mage-eventpress'); ?></span></th> <th><span><?php _e('State: ', 'mage-eventpress'); ?></span></th>
<td> <td>
<label> <label>
<input type="text" name='mep_state' placeholder="Ex: NY" class="mp_formControl" <input type="text" name='mep_state' placeholder="Ex: NY" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_state'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_state' ); ?>'>
</label> </label>
</td> </td>
</tr> </tr>
@ -205,15 +191,13 @@ class MP_Event_All_Info_In_One {
<th><span><?php _e('Postcode: ', 'mage-eventpress'); ?></span></th> <th><span><?php _e('Postcode: ', 'mage-eventpress'); ?></span></th>
<td> <td>
<label> <label>
<input type="text" name='mep_postcode' placeholder="Ex: 10016" class="mp_formControl" <input type="text" name='mep_postcode' placeholder="Ex: 10016" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_postcode'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_postcode' ); ?>'>
</label> </label>
</td> </td>
<th><span><?php _e('Country: ', 'mage-eventpress'); ?></span></th> <th><span><?php _e('Country: ', 'mage-eventpress'); ?></span></th>
<td> <td>
<label> <label>
<input type="text" name='mep_country' placeholder="Ex: USA" class="mp_formControl" <input type="text" name='mep_country' placeholder="Ex: USA" class="mp_formControl" value='<?php echo mep_get_event_locaion_item($post_id, 'mep_country'); ?>'>
value='<?php echo mep_get_event_locaion_item( $post_id, 'mep_country' ); ?>'>
</label> </label>
</td> </td>
</tr> </tr>
@ -250,8 +234,6 @@ class MP_Event_All_Info_In_One {
<input type="hidden" class="form-control" required name="longitude" value="<?php if (array_key_exists('longitude', $values)) { <input type="hidden" class="form-control" required name="longitude" value="<?php if (array_key_exists('longitude', $values)) {
echo $values['longitude'][0]; echo $values['longitude'][0];
} ?>"> } ?>">
<div id="map"></div> <div id="map"></div>
<?php <?php
@ -296,7 +278,10 @@ class MP_Event_All_Info_In_One {
map: map, map: map,
anchorPoint: new google.maps.Point(0, -29), anchorPoint: new google.maps.Point(0, -29),
draggable: true, draggable: true,
position: {lat: <?php echo $lat; ?>, lng: <?php echo $lon; ?>} position: {
lat: <?php echo $lat; ?>,
lng: <?php echo $lon; ?>
}
}); });
google.maps.event.addListener(marker, 'dragend', function() { google.maps.event.addListener(marker, 'dragend', function() {
@ -395,7 +380,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mep_event_ticket_type( $post_id ) { public function mep_event_ticket_type($post_id)
{
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true);
wp_nonce_field('mep_event_ticket_type_nonce', 'mep_event_ticket_type_nonce'); wp_nonce_field('mep_event_ticket_type_nonce', 'mep_event_ticket_type_nonce');
?> ?>
@ -486,7 +472,7 @@ class MP_Event_All_Info_In_One {
<?php apply_filters('mep_add_field_to_ticket_type', $option_rsv_t); ?> <?php apply_filters('mep_add_field_to_ticket_type', $option_rsv_t); ?>
<td> <td>
<select name="option_qty_t_type[]" class='mp_formControl'> <select name="option_qty_t_type[]" class='mp_formControl'>
<option value=''>Please Select</option> <option value=''><?php _e('Please Select', 'mage-eventpress'); ?></option>
<option value="inputbox"><?php _e('Input Box', 'mage-eventpress'); ?></option> <option value="inputbox"><?php _e('Input Box', 'mage-eventpress'); ?></option>
<option value="dropdown"><?php _e('Dropdown List', 'mage-eventpress'); ?></option> <option value="dropdown"><?php _e('Dropdown List', 'mage-eventpress'); ?></option>
</select></td> </select></td>
@ -502,11 +488,12 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mep_event_extra_price_option( $post_id ) { public function mep_event_extra_price_option($post_id)
{
$mep_events_extra_prices = get_post_meta($post_id, 'mep_events_extra_prices', true); $mep_events_extra_prices = get_post_meta($post_id, 'mep_events_extra_prices', true);
wp_nonce_field('mep_events_extra_price_nonce', 'mep_events_extra_price_nonce'); wp_nonce_field('mep_events_extra_price_nonce', 'mep_events_extra_price_nonce');
?> ?>
<p class="event_meta_help_txt">Extra Service as Product that you can sell and it is not included on event package</p> <p class="event_meta_help_txt"><?php _e('Extra Service as Product that you can sell and it is not included on event package', 'mage-eventpress'); ?></p>
<table id="repeatable-fieldset-one" width="100%"> <table id="repeatable-fieldset-one" width="100%">
<thead> <thead>
@ -531,8 +518,7 @@ class MP_Event_All_Info_In_One {
echo esc_attr($field['option_name']); echo esc_attr($field['option_name']);
} ?>" /></td> } ?>" /></td>
<td><input type="number" step="0.01" class="mp_formControl" name="option_price[]" <td><input type="number" step="0.01" class="mp_formControl" name="option_price[]" placeholder="Ex: 10" value="<?php if ($field['option_price'] != '') {
placeholder="Ex: 10" value="<?php if ( $field['option_price'] != '' ) {
echo esc_attr($field['option_price']); echo esc_attr($field['option_price']);
} else { } else {
echo ''; echo '';
@ -580,26 +566,19 @@ class MP_Event_All_Info_In_One {
<option value="dropdown"><?php _e('Dropdown List', 'mage-eventpress'); ?></option> <option value="dropdown"><?php _e('Dropdown List', 'mage-eventpress'); ?></option>
</select></td> </select></td>
<td> <td>
<button class="button remove-row"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span><?php _e('Remove', 'mage-eventpress'); ?></button> <button class="button remove-row"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span><?php _e('Remove', 'mage-eventpress'); ?></button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p> <p>
<button id="add-row" class="button" style="background:green; color:white;"><span class="dashicons dashicons-plus-alt" style="margin-top: 3px;color: white;"></span><?php _e('Add Extra Price', 'mage-eventpress'); ?></button> <button id="add-row" class="button" style="background:green; color:white;"><span class="dashicons dashicons-plus-alt" style="margin-top: 3px;color: white;"></span><?php _e('Add Extra Price', 'mage-eventpress'); ?></button>
</p> </p>
<?php <?php
} }
public function mep_event_date_meta_box_cb( $post_id ) { public function mep_event_date_meta_box_cb($post_id)
{
$values = get_post_custom($post_id); $values = get_post_custom($post_id);
?> ?>
<div class="sec"> <div class="sec">
@ -706,151 +685,11 @@ class MP_Event_All_Info_In_One {
do_action('mep_after_date_section', $post_id); do_action('mep_after_date_section', $post_id);
} }
public function mep_event_faq_meta_box_cb( $post_id ) {
$mep_event_faq = get_post_meta( $post_id, 'mep_event_faq', true );
wp_nonce_field( 'mep_event_faq_nonce', 'mep_event_faq_nonce' );
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#add-faq-row').on('click', function () {
var row = $('.empty-row-faq.screen-reader-text').clone(true);
row.removeClass('empty-row-faq screen-reader-text');
row.insertBefore('#repeatable-fieldset-faq-one tbody>tr:last');
return false;
});
$('.remove-faq-row').on('click', function () {
$(this).parents('tr').remove();
return false;
});
});
</script>
<table id="repeatable-fieldset-faq-one" width="100%">
<tbody>
<?php
if ( $mep_event_faq ) :
foreach ( $mep_event_faq as $field ) {
?>
<tr>
<td>
<div id='mep_event_faq_r' class="">
<input placeholder="FAQ Title" type="text" class="mep-faq-input" value="<?php if ( $field['mep_faq_title'] != '' ) {
echo esc_attr( $field['mep_faq_title'] );
} ?>" name="mep_faq_title[]">
<textarea placeholder="FAQ Contents" name="mep_faq_content[]" id="" cols="50" rows="4" class="mep-faq-input"><?php if ( $field['mep_faq_content'] != '' ) {
echo esc_attr( $field['mep_faq_content'] );
} ?></textarea>
<a class="button remove-faq-row" href="#"><?php _e( 'Remove', 'mage-eventpress' ); ?></a>
</div>
</td>
</tr>
<?php
}
else :
// show a blank one
endif;
?>
<!-- empty hidden one for jQuery -->
<tr class="empty-row-faq screen-reader-text">
<td>
<div id='mep_event_faq_r' class="">
<input placeholder="FAQ Title" type="text" class="mep-faq-input" name="mep_faq_title[]">
<textarea placeholder="<?php _e( 'FAQ Contents', 'mage-eventpress' ); ?>" name="mep_faq_content[]" id="" cols="50" rows="4" class="mep-faq-input"></textarea>
<button class="button remove-faq-row"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span><?php _e( 'Remove', 'mage-eventpress' ); ?></button>
</div>
</td>
</tr>
</tbody>
</table>
<p>
<button id="add-faq-row" class="button " style="background:green; color:white;"><span class="dashicons dashicons-plus-alt" style="margin-top: 3px;color: white;"></span><?php _e( 'Add New F.A.Q', 'mage-eventpress' ); ?></button>
</p>
<?php public function mp_event_rich_text($post_id)
} {
public function mep_event_day_details_cb( $post_id ) {
$mep_event_day = get_post_meta( $post_id, 'mep_event_day', true );
wp_nonce_field( 'mep_event_day_nonce', 'mep_event_day_nonce' );
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#add-day-row').on('click', function () {
var row = $('.empty-row-day.screen-reader-text').clone(true);
row.removeClass('empty-row-day screen-reader-text');
row.insertBefore('#repeatable-fieldset-day-one tbody>tr:last');
return false;
});
$('.remove-day-row').on('click', function () {
$(this).parents('tr').remove();
return false;
});
});
</script>
<table id="repeatable-fieldset-day-one" width="100%">
<tbody>
<?php
if ( $mep_event_day ) :
foreach ( $mep_event_day as $field ) {
?>
<tr>
<td>
<div id='mep_event_day_r' class="">
<input placeholder="Day Title" type="text" class="mep-faq-input" value="<?php if ( $field['mep_day_title'] != '' ) {
echo esc_attr( $field['mep_day_title'] );
} ?>" name="mep_day_title[]">
<textarea placeholder="Day Details" name="mep_day_content[]" id="" cols="50" rows="4" class="mep-faq-input"><?php if ( $field['mep_day_content'] != '' ) {
echo esc_attr( $field['mep_day_content'] );
} ?></textarea>
<a class="button remove-day-row" href="#"><?php _e( 'Remove', 'mage-eventpress' ); ?></a>
</div>
</td>
</tr>
<?php
}
else :
// show a blank one
endif;
?>
<!-- empty hidden one for jQuery -->
<tr class="empty-row-day screen-reader-text">
<td>
<div id='mep_event_day_r' class="">
<input placeholder="Day Title" type="text" class="mep-faq-input" name="mep_day_title[]">
<textarea placeholder="<?php _e( 'Day Details', 'mage-eventpress' ); ?>" name="mep_day_content[]" id="" cols="50" rows="4" class="mep-faq-input"></textarea>
<button class="button remove-day-row"><span class="dashicons dashicons-trash" style="margin-top: 3px;color: red;"></span><?php _e( 'Remove', 'mage-eventpress' ); ?></button>
</div>
</td>
</tr>
</tbody>
</table>
<p>
<button id="add-day-row" class="button" style="background:green; color:white;"><span class="dashicons dashicons-plus-alt" style="margin-top: 3px;color: white;"></span><?php _e( 'Add New Day', 'mage-eventpress' ); ?></button>
</p>
<?php
}
public function mp_event_rich_text( $post_id ) {
wp_nonce_field('mep_event_ricn_text_nonce', 'mep_event_ricn_text_nonce'); wp_nonce_field('mep_event_ricn_text_nonce', 'mep_event_ricn_text_nonce');
$event_start_date = get_post_meta($post_id, 'event_start_datetime', true) ? get_post_meta($post_id, 'event_start_datetime', true) : ''; $event_start_date = get_post_meta($post_id, 'event_start_datetime', true) ? get_post_meta($post_id, 'event_start_datetime', true) : '';
$event_end_date = get_post_meta($post_id, 'event_end_datetime', true) ? get_post_meta($post_id, 'event_end_datetime', true) : ''; $event_end_date = get_post_meta($post_id, 'event_end_datetime', true) ? get_post_meta($post_id, 'event_end_datetime', true) : '';
@ -925,7 +764,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_settings( $post_id ) { public function mp_event_settings($post_id)
{
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
?> ?>
<table> <table>
@ -940,7 +780,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_reg_status( $post_id ) { public function mp_event_reg_status($post_id)
{
$values = get_post_custom($post_id); $values = get_post_custom($post_id);
wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce'); wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce');
$reg_checked = ''; $reg_checked = '';
@ -965,7 +806,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_available_seat_status( $post_id ) { public function mp_event_available_seat_status($post_id)
{
$values = get_post_custom($post_id); $values = get_post_custom($post_id);
wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce'); wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce');
$seat_checked = ''; $seat_checked = '';
@ -989,7 +831,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_reset_booking_count( $post_id ) { public function mp_event_reset_booking_count($post_id)
{
wp_nonce_field('mep_event_reset_btn_nonce', 'mep_event_reset_btn_nonce'); wp_nonce_field('mep_event_reset_btn_nonce', 'mep_event_reset_btn_nonce');
?> ?>
<tr> <tr>
@ -1013,14 +856,16 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_speaker_ticket_type($post_id){ public function mp_event_speaker_ticket_type($post_id)
{
$event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events'); $event_label = mep_get_option('mep_event_label', 'general_setting_sec', 'Events');
$event_type = get_post_meta($post_id, 'mep_event_type', true); $event_type = get_post_meta($post_id, 'mep_event_type', true);
$description = get_post_meta($post_id, 'mp_event_virtual_type_des', true); $description = get_post_meta($post_id, 'mp_event_virtual_type_des', true);
$checked = ($event_type == 'online') ? 'checked' : ''; $checked = ($event_type == 'online') ? 'checked' : '';
?> ?>
<tr> <tr>
<th><span><?php echo $event_label; _e( ' Is Virtual?', 'mage-eventpress' ); ?></span></th> <th><span><?php echo $event_label;
_e(' Is Virtual?', 'mage-eventpress'); ?></span></th>
<td colspan="3"> <td colspan="3">
<label class="mp_event_virtual_type_des_switch"> <label class="mp_event_virtual_type_des_switch">
<input class="mp_opacity_zero" type="checkbox" name="mep_event_type" <?php echo $checked; ?> /> <input class="mp_opacity_zero" type="checkbox" name="mep_event_type" <?php echo $checked; ?> />
@ -1035,7 +880,8 @@ class MP_Event_All_Info_In_One {
<?php <?php
} }
public function mp_event_tax( $post_id ) { public function mp_event_tax($post_id)
{
$values = get_post_custom($post_id); $values = get_post_custom($post_id);
wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce'); wp_nonce_field('mep_event_reg_btn_nonce', 'mep_event_reg_btn_nonce');
if (array_key_exists('_tax_status', $values)) { if (array_key_exists('_tax_status', $values)) {
@ -1082,7 +928,8 @@ class MP_Event_All_Info_In_One {
} }
//side meta box //side meta box
public function mep_event_template_meta_box_cb( $post ) { public function mep_event_template_meta_box_cb($post)
{
$values = get_post_custom($post->ID); $values = get_post_custom($post->ID);
$global_template = mep_get_option('mep_global_single_template', 'general_setting_sec', 'theme-2'); $global_template = mep_get_option('mep_global_single_template', 'general_setting_sec', 'theme-2');
if (array_key_exists('mep_event_template', $values)) { if (array_key_exists('mep_event_template', $values)) {
@ -1101,190 +948,25 @@ class MP_Event_All_Info_In_One {
</div> </div>
<?php <?php
} }
} }
new MP_Event_All_Info_In_One(); new MP_Event_All_Info_In_One();
add_action( 'save_post', 'mep_reg_status_meta_save' );
function mep_reg_status_meta_save( $post_id ) {
global $wpdb;
if ( ! isset( $_POST['mep_event_reg_btn_nonce'] ) ||
! wp_verify_nonce( $_POST['mep_event_reg_btn_nonce'], 'mep_event_reg_btn_nonce' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( get_post_type( $post_id ) == 'mep_events' ) {
if ( isset( $_POST['mep_reg_status'] ) ) {
$mep_reg_status = strip_tags( $_POST['mep_reg_status'] );
} else {
$mep_reg_status = 'off';
}
if ( isset( $_POST['mep_reset_status'] ) ) {
$mep_reset_status = strip_tags( $_POST['mep_reset_status'] );
} else {
$mep_reset_status = 'off';
}
if ( isset( $_POST['mep_available_seat'] ) ) {
$mep_available_seat = strip_tags( $_POST['mep_available_seat'] );
} else {
$mep_available_seat = 'off';
}
if ( $mep_reset_status == 'on' ) {
mep_reset_event_booking( $post_id );
}
if ( isset( $_POST['_tax_status'] ) ) {
$_tax_status = strip_tags( $_POST['_tax_status'] );
} else {
$_tax_status = 'none';
}
if ( isset( $_POST['_tax_class'] ) ) {
$_tax_class = strip_tags( $_POST['_tax_class'] );
} else {
$_tax_class = '';
}
$update_ava_seat = update_post_meta( $post_id, 'mep_available_seat', $mep_available_seat );
$update_seat = update_post_meta( $post_id, 'mep_reg_status', $mep_reg_status );
$update__tax_status = update_post_meta( $post_id, '_tax_status', $_tax_status );
$update__tax_class = update_post_meta( $post_id, '_tax_class', $_tax_class );
}
}
add_action( 'save_post', 'mep_event_faq_save' );
function mep_event_faq_save( $post_id ) {
global $wpdb;
if ( ! isset( $_POST['mep_event_faq_nonce'] ) ||
! wp_verify_nonce( $_POST['mep_event_faq_nonce'], 'mep_event_faq_nonce' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( get_post_type( $post_id ) == 'mep_events' ) {
$old = get_post_meta( $post_id, 'mep_event_faq', true );
$new = array();
// $options = hhs_get_sample_options();
$names = $_POST['mep_faq_title'];
$cntent = $_POST['mep_faq_content'];
$order_id = 0;
$count = count( $names );
for ( $i = 0; $i < $count; $i ++ ) {
if ( $names[ $i ] != '' ) :
$new[ $i ]['mep_faq_title'] = stripslashes( strip_tags( $names[ $i ] ) );
endif;
if ( $cntent[ $i ] != '' ) :
$new[ $i ]['mep_faq_content'] = stripslashes( strip_tags( $cntent[ $i ] ) );
endif;
}
if ( ! empty( $new ) && $new != $old ) {
update_post_meta( $post_id, 'mep_event_faq', $new );
} elseif ( empty( $new ) && $old ) {
delete_post_meta( $post_id, 'mep_event_faq', $old );
}
}
}
add_action( 'save_post', 'mep_event_day_data_save' );
function mep_event_day_data_save( $post_id ) {
global $wpdb;
if ( ! isset( $_POST['mep_event_day_nonce'] ) ||
! wp_verify_nonce( $_POST['mep_event_day_nonce'], 'mep_event_day_nonce' ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
return;
}
if ( get_post_type( $post_id ) == 'mep_events' ) {
$old = get_post_meta( $post_id, 'mep_event_day', true );
$new = array();
// $options = hhs_get_sample_options();
$names = $_POST['mep_day_title'];
$cntent = $_POST['mep_day_content'];
$order_id = 0;
$count = count( $names );
for ( $i = 0; $i < $count; $i ++ ) {
if ( $names[ $i ] != '' ) :
$new[ $i ]['mep_day_title'] = stripslashes( strip_tags( $names[ $i ] ) );
endif;
if ( $cntent[ $i ] != '' ) :
$new[ $i ]['mep_day_content'] = stripslashes( strip_tags( $cntent[ $i ] ) );
endif;
}
if ( ! empty( $new ) && $new != $old ) {
update_post_meta( $post_id, 'mep_event_day', $new );
} elseif ( empty( $new ) && $old ) {
delete_post_meta( $post_id, 'mep_event_day', $old );
}
}
}
add_action('save_post', 'mep_events_ticket_type_save'); add_action('save_post', 'mep_events_ticket_type_save');
function mep_events_ticket_type_save( $post_id ) { function mep_events_ticket_type_save($post_id)
{
global $wpdb; global $wpdb;
if (
if ( ! isset( $_POST['mep_event_ticket_type_nonce'] ) || !isset($_POST['mep_event_ticket_type_nonce']) ||
! wp_verify_nonce( $_POST['mep_event_ticket_type_nonce'], 'mep_event_ticket_type_nonce' ) ) { !wp_verify_nonce($_POST['mep_event_ticket_type_nonce'], 'mep_event_ticket_type_nonce')
) {
return; return;
} }
@ -1313,24 +995,15 @@ function mep_events_ticket_type_save( $post_id ) {
$count = count($names); $count = count($names);
for ($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
// $new[$i]['option_name_t'] = !empty($names[$i]) ? stripslashes( strip_tags( $names[$i] ) ) : '';
// $new[$i]['option_price_t'] = !empty($ticket_price[$i]) ? stripslashes( strip_tags( $ticket_price[$i] ) ) : '';
// $new[$i]['option_qty_t'] = !empty($qty[$i]) ? stripslashes( strip_tags( $qty[$i] ) ) : '';
// $new[$i]['option_rsv_t'] = !empty($rsv[$i]) ? stripslashes( strip_tags( $rsv[$i] ) ) : '';
// $new[$i]['option_default_qty_t'] = !empty($dflt_qty[$i]) ? stripslashes( strip_tags( $dflt_qty[$i] ) ) : '';
// $new[$i]['option_qty_t_type'] = !empty($qty_type[$i]) ? stripslashes( strip_tags( $qty_type[$i] ) ) : '';
if ($names[$i] != '') : if ($names[$i] != '') :
$new[$i]['option_name_t'] = stripslashes(strip_tags($names[$i])); $new[$i]['option_name_t'] = stripslashes(strip_tags($names[$i]));
endif; endif;
if ($ticket_price[$i] != '') : if ($ticket_price[$i] != '') :
$new[$i]['option_price_t'] = stripslashes(strip_tags($ticket_price[$i])); $new[$i]['option_price_t'] = stripslashes(strip_tags($ticket_price[$i]));
endif; endif;
if ($qty[$i] != '') : if ($qty[$i] != '') :
$new[$i]['option_qty_t'] = stripslashes(strip_tags($qty[$i])); $new[$i]['option_qty_t'] = stripslashes(strip_tags($qty[$i]));
endif; endif;
@ -1340,7 +1013,6 @@ function mep_events_ticket_type_save( $post_id ) {
$new[$i]['option_rsv_t'] = stripslashes(strip_tags($rsv[$i])); $new[$i]['option_rsv_t'] = stripslashes(strip_tags($rsv[$i]));
endif; endif;
if ($dflt_qty[$i] != '') : if ($dflt_qty[$i] != '') :
$new[$i]['option_default_qty_t'] = stripslashes(strip_tags($dflt_qty[$i])); $new[$i]['option_default_qty_t'] = stripslashes(strip_tags($dflt_qty[$i]));
endif; endif;
@ -1348,7 +1020,6 @@ function mep_events_ticket_type_save( $post_id ) {
if ($qty_type[$i] != '') : if ($qty_type[$i] != '') :
$new[$i]['option_qty_t_type'] = stripslashes(strip_tags($qty_type[$i])); $new[$i]['option_qty_t_type'] = stripslashes(strip_tags($qty_type[$i]));
endif; endif;
} }
$ticket_type_list = apply_filters('mep_ticket_type_arr_save', $new); $ticket_type_list = apply_filters('mep_ticket_type_arr_save', $new);
@ -1363,11 +1034,14 @@ function mep_events_ticket_type_save( $post_id ) {
} }
add_action('save_post', 'mep_events_repeatable_meta_box_save'); add_action('save_post', 'mep_events_repeatable_meta_box_save');
function mep_events_repeatable_meta_box_save( $post_id ) { function mep_events_repeatable_meta_box_save($post_id)
{
global $wpdb; global $wpdb;
$table_name = $wpdb->prefix . 'event_extra_options'; $table_name = $wpdb->prefix . 'event_extra_options';
if ( ! isset( $_POST['mep_events_extra_price_nonce'] ) || if (
! wp_verify_nonce( $_POST['mep_events_extra_price_nonce'], 'mep_events_extra_price_nonce' ) ) { !isset($_POST['mep_events_extra_price_nonce']) ||
!wp_verify_nonce($_POST['mep_events_extra_price_nonce'], 'mep_events_extra_price_nonce')
) {
return; return;
} }
@ -1384,16 +1058,10 @@ function mep_events_repeatable_meta_box_save( $post_id ) {
$old = get_post_meta($post_id, 'mep_events_extra_prices', true); $old = get_post_meta($post_id, 'mep_events_extra_prices', true);
$new = array(); $new = array();
// $options = hhs_get_sample_options();
$names = $_POST['option_name']; $names = $_POST['option_name'];
// $selects = $_POST['select'];
$urls = $_POST['option_price']; $urls = $_POST['option_price'];
$qty = $_POST['option_qty']; $qty = $_POST['option_qty'];
$qty_type = $_POST['option_qty_type']; $qty_type = $_POST['option_qty_type'];
// $required = $_POST['option_required'];
// $total_sold = $_POST['option_sold'];
$order_id = 0; $order_id = 0;
$count = count($names); $count = count($names);
@ -1414,16 +1082,6 @@ function mep_events_repeatable_meta_box_save( $post_id ) {
if ($qty_type[$i] != '') : if ($qty_type[$i] != '') :
$new[$i]['option_qty_type'] = stripslashes(strip_tags($qty_type[$i])); $new[$i]['option_qty_type'] = stripslashes(strip_tags($qty_type[$i]));
endif; endif;
// if ( $required[$i] != '' ) :
// $new[$i]['option_required'] = stripslashes( strip_tags( $required[$i] ) );
// endif;
$opt_name = $post_id . str_replace( ' ', '', $names[ $i ] );
// update_post_meta( $post_id, "mep_xtra_$opt_name",0 );
} }
if (!empty($new) && $new != $old) { if (!empty($new) && $new != $old) {
@ -1432,14 +1090,16 @@ function mep_events_repeatable_meta_box_save( $post_id ) {
delete_post_meta($post_id, 'mep_events_extra_prices', $old); delete_post_meta($post_id, 'mep_events_extra_prices', $old);
} }
} }
} }
/** /**
* Now Saving the Event Meta Field Data * Now Saving the Event Meta Field Data
*/ */
add_action('save_post', 'mep_event_meta_save'); add_action('save_post', 'mep_event_meta_save');
function mep_event_meta_save( $post_id ) { function mep_event_meta_save($post_id)
{
if (!isset($_POST['mep_event_ricn_text_nonce']) || !wp_verify_nonce($_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce')) { if (!isset($_POST['mep_event_ricn_text_nonce']) || !wp_verify_nonce($_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce')) {
return; return;
@ -1458,10 +1118,9 @@ function mep_event_meta_save( $post_id ) {
* If the saving post is event then go on * If the saving post is event then go on
*/ */
if (get_post_type($post_id) == 'mep_events') { if (get_post_type($post_id) == 'mep_events') {
$pid = $post_id; $pid = $post_id;
$oldm = get_post_meta($post_id, 'mep_event_more_date', true); $oldm = get_post_meta($post_id, 'mep_event_more_date', true);
$more_start_date = isset($_POST['event_more_start_date']) ? $_POST['event_more_start_date'] : array(); $more_start_date = isset($_POST['event_more_start_date']) ? $_POST['event_more_start_date'] : array();
$more_start_time = isset($_POST['event_more_start_time']) ? $_POST['event_more_start_time'] : ''; $more_start_time = isset($_POST['event_more_start_time']) ? $_POST['event_more_start_time'] : '';
$more_end_date = isset($_POST['event_more_end_date']) ? $_POST['event_more_end_date'] : ''; $more_end_date = isset($_POST['event_more_end_date']) ? $_POST['event_more_end_date'] : '';
@ -1492,9 +1151,7 @@ function mep_event_meta_save( $post_id ) {
$mep_state = isset($_POST['mep_state']) ? strip_tags($_POST['mep_state']) : ""; $mep_state = isset($_POST['mep_state']) ? strip_tags($_POST['mep_state']) : "";
$mep_postcode = isset($_POST['mep_postcode']) ? strip_tags($_POST['mep_postcode']) : ""; $mep_postcode = isset($_POST['mep_postcode']) ? strip_tags($_POST['mep_postcode']) : "";
$mep_country = isset($_POST['mep_country']) ? strip_tags($_POST['mep_country']) : ""; $mep_country = isset($_POST['mep_country']) ? strip_tags($_POST['mep_country']) : "";
// $mep_price_label = isset($_POST['mep_price_label']) ? strip_tags( $_POST['mep_price_label'] ) : "";
// $mep_sqi = isset($_POST['mep_sqi']) ? strip_tags( $_POST['mep_sqi'] ) : "";
// $qty_box_type = isset($_POST['qty_box_type']) ? strip_tags( $_POST['qty_box_type'] ) : "";
$mep_sgm = isset($_POST['mep_sgm']) ? strip_tags($_POST['mep_sgm']) : ""; $mep_sgm = isset($_POST['mep_sgm']) ? strip_tags($_POST['mep_sgm']) : "";
$mep_org_address = isset($_POST['mep_org_address']) ? strip_tags($_POST['mep_org_address']) : ""; $mep_org_address = isset($_POST['mep_org_address']) ? strip_tags($_POST['mep_org_address']) : "";
$_price = isset($_POST['_price']) ? strip_tags($_POST['_price']) : ""; $_price = isset($_POST['_price']) ? strip_tags($_POST['_price']) : "";
@ -1503,9 +1160,6 @@ function mep_event_meta_save( $post_id ) {
$event_start_time = strip_tags($_POST['event_start_time']); $event_start_time = strip_tags($_POST['event_start_time']);
$event_end_date = strip_tags($_POST['event_end_date']); $event_end_date = strip_tags($_POST['event_end_date']);
$event_end_time = strip_tags($_POST['event_end_time']); $event_end_time = strip_tags($_POST['event_end_time']);
// $mep_event_end_date = strip_tags($_POST['mep_event_end_date']);
// $mep_event_cc_email_text = $_POST['mep_event_cc_email_text'];
$latitude = isset($_POST['latitude']) ? strip_tags($_POST['latitude']) : ""; $latitude = isset($_POST['latitude']) ? strip_tags($_POST['latitude']) : "";
$longitude = isset($_POST['latitude']) ? strip_tags($_POST['longitude']) : ""; $longitude = isset($_POST['latitude']) ? strip_tags($_POST['longitude']) : "";
@ -1531,6 +1185,23 @@ function mep_event_meta_save( $post_id ) {
$event_expire_datetime = sizeof($md) > 0 ? date('Y-m-d H:i:s', strtotime($md['event_more_end_date'] . ' ' . $md['event_more_end_time'])) : $event_end_datetime; $event_expire_datetime = sizeof($md) > 0 ? date('Y-m-d H:i:s', strtotime($md['event_more_end_date'] . ' ' . $md['event_more_end_time'])) : $event_end_datetime;
$mep_reg_status = isset($_POST['mep_reg_status']) ? strip_tags($_POST['mep_reg_status']) : 'off';
$mep_reset_status = isset($_POST['mep_reset_status']) ? strip_tags($_POST['mep_reset_status']) : 'off';
$mep_available_seat = isset($_POST['mep_available_seat']) ? strip_tags($_POST['mep_available_seat']) : 'off';
$_tax_status = isset($_POST['_tax_status']) ? strip_tags($_POST['_tax_status']) : 'none';
$_tax_class = isset($_POST['_tax_class']) ? strip_tags($_POST['_tax_class']) : '';
if ($mep_reset_status == 'on') {
mep_reset_event_booking($post_id);
}
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, '_tax_status', $_tax_status);
update_post_meta($post_id, '_tax_class', $_tax_class);
update_post_meta($post_id, 'mep_rt_event_status', $event_rt_status); update_post_meta($post_id, 'mep_rt_event_status', $event_rt_status);
update_post_meta($post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode); update_post_meta($post_id, 'mep_rt_event_attandence_mode', $event_rt_atdnce_mode);
update_post_meta($post_id, 'mep_rt_event_prvdate', $event_rt_prv_date); update_post_meta($post_id, 'mep_rt_event_prvdate', $event_rt_prv_date);
@ -1556,7 +1227,6 @@ function mep_event_meta_save( $post_id ) {
update_post_meta($post_id, 'event_start_datetime', $event_start_datetime); update_post_meta($post_id, 'event_start_datetime', $event_start_datetime);
update_post_meta($post_id, 'event_end_datetime', $event_end_datetime); update_post_meta($post_id, 'event_end_datetime', $event_end_datetime);
update_post_meta($post_id, 'event_expire_datetime', $event_expire_datetime); update_post_meta($post_id, 'event_expire_datetime', $event_expire_datetime);
//update_post_meta( $pid, '_manage_stock', $st_msg );
update_post_meta($pid, '_stock', $seat); update_post_meta($pid, '_stock', $seat);
update_post_meta($pid, '_stock_msg', 'new'); update_post_meta($pid, '_stock_msg', 'new');
update_post_meta($pid, 'longitude', $longitude); update_post_meta($pid, 'longitude', $longitude);
@ -1569,13 +1239,9 @@ function mep_event_meta_save( $post_id ) {
update_post_meta($pid, 'mep_state', $mep_state); update_post_meta($pid, 'mep_state', $mep_state);
update_post_meta($pid, 'mep_postcode', $mep_postcode); update_post_meta($pid, 'mep_postcode', $mep_postcode);
update_post_meta($pid, 'mep_country', $mep_country); update_post_meta($pid, 'mep_country', $mep_country);
// update_post_meta( $pid, 'mep_sqi', $mep_sqi);
// update_post_meta( $pid, 'qty_box_type', $qty_box_type);
update_post_meta($pid, 'mep_sgm', $mep_sgm); update_post_meta($pid, 'mep_sgm', $mep_sgm);
// update_post_meta( $pid, 'mep_price_label', $mep_price_label);
update_post_meta($pid, '_price', 0); update_post_meta($pid, '_price', 0);
update_post_meta($pid, '_virtual', 'yes'); update_post_meta($pid, '_virtual', 'yes');
// update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text);
update_post_meta($pid, '_sku', $pid); update_post_meta($pid, '_sku', $pid);
if (isset($_POST['mep_event_type']) && strip_tags($_POST['mep_event_type'])) { if (isset($_POST['mep_event_type']) && strip_tags($_POST['mep_event_type'])) {
@ -1594,6 +1260,4 @@ function mep_event_meta_save( $post_id ) {
delete_post_meta($post_id, 'mep_event_more_date', $oldm); delete_post_meta($post_id, 'mep_event_more_date', $oldm);
} }
} }
} }

View File

@ -1,8 +1,10 @@
jQuery(document).ready(function ($) { (function ($) {
"use strict"; "use strict";
// Tabs // Tabs
$(window).load(function () { $(window).load(function () {
$('.mp_event_all_meta_in_tab .mp_tab_menu li:first-child[data-target-tabs]').trigger('click'); $('.mp_tab_menu').each(function () {
$(this).find('ul li:first-child').trigger('click');
});
if ($('[name="mep_org_address"]').val() > 0) { if ($('[name="mep_org_address"]').val() > 0) {
$('.mp_event_address').slideUp(250); $('.mp_event_address').slideUp(250);
} }
@ -11,10 +13,10 @@ jQuery(document).ready(function ($) {
$(document).on('click', '[data-target-tabs]', function () { $(document).on('click', '[data-target-tabs]', function () {
if (!$(this).hasClass('active')) { if (!$(this).hasClass('active')) {
let tabsTarget = $(this).attr('data-target-tabs'); let tabsTarget = $(this).attr('data-target-tabs');
let targetParent = $(this).parents('.mp_event_all_meta_in_tab'); let targetParent = $(this).closest('.mp_event_tab_area').find('.mp_tab_details').first();
targetParent.find('.mp_tab_item.active').removeClass('active').slideUp('fast'); targetParent.children('.mp_tab_item:visible').slideUp('fast');
targetParent.find('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').addClass('active').slideDown(250); targetParent.children('.mp_tab_item[data-tab-item="' + tabsTarget + '"]').slideDown(250);
targetParent.find('li.active').removeClass('active'); $(this).siblings('li.active').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
} }
return false; return false;
@ -36,7 +38,7 @@ jQuery(document).ready(function ($) {
row.removeClass('empty-row-t screen-reader-text'); row.removeClass('empty-row-t screen-reader-text');
row.insertBefore('#repeatable-fieldset-one-t tbody>tr:last'); row.insertBefore('#repeatable-fieldset-one-t tbody>tr:last');
$('#mep_ticket_type_empty option[value=inputbox]').attr('selected', 'selected'); $('#mep_ticket_type_empty option[value=inputbox]').attr('selected', 'selected');
jQuery('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected'); $('.empty-row-t #mep_ticket_type_empty option[value=inputbox]').removeAttr('selected');
return false; return false;
}); });
@ -84,4 +86,4 @@ jQuery(document).ready(function ($) {
} }
}); });
}); }(jQuery));