new version 2.1.8 released

This commit is contained in:
magepeopleteam 2018-11-25 08:38:14 +00:00
parent f6eba5c93d
commit 207c868444
7 changed files with 27 additions and 305 deletions

View File

@ -1393,8 +1393,10 @@ h4.mep-cart-table-title {
margin: 0;
}
.mep-default-sidrbar-address ul li p{
margin: -26px 0 0;
padding: 0 0 0 25px;
}
/* Responsive CSS
=====================================================================*/
@media only screen and (min-width: 768px) and (max-width: 990px) {

View File

@ -46,17 +46,5 @@ function mep_cpt() {
);
register_post_type( 'mep_events', $args );
$argsl = array(
'public' => true,
'label' => 'Event Attendees',
'menu_icon' => 'dashicons-id',
'supports' => array('title'),
'show_in_menu' => 'edit.php?post_type=mep_events'
);
register_post_type( 'mep_events_attendees', $argsl );
}
add_action( 'init', 'mep_cpt' );

View File

@ -17,7 +17,7 @@ function mep_event_meta_box_add(){
add_meta_box( 'mep-event-template', 'Template', 'mep_event_template_meta_box_cb', 'mep_events', 'side', 'low' );
add_meta_box( 'mep-event-reg-form', 'Event Registration Form', 'mep_event_reg_form_meta_box_cb', 'mep_events', 'normal', 'high' );
add_meta_box( 'mep-event-faq-box', 'Event F.A.Q', 'mep_event_faq_meta_box_cb', 'mep_events', 'normal', 'high' );
@ -626,71 +626,6 @@ $values = get_post_custom( $post->ID );
function mep_event_reg_form_meta_box_cb($post){
$values = get_post_custom( $post->ID );
?>
<div class='sec'>
<label for="mep_ev_98">
<span><input style='text-align: left;width: auto;' id='mep_ev_98' type="checkbox" name='mep_full_name' <?php if(array_key_exists('mep_full_name', $values)){ $sqi = $values['mep_full_name'][0]; }else{$sqi=0; } if($sqi==1){ echo 'checked'; } ?> value='1' /> <?php _e('Full Name','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_981">
<span><input style='text-align: left;width: auto;' id='mep_ev_981' type="checkbox" name='mep_reg_email' <?php if(array_key_exists('mep_reg_email', $values)){ $sqi1 = $values['mep_reg_email'][0]; }else{$sqi1=0;} if($sqi1==1){ echo 'checked'; } ?> value='1' /> <?php _e('Email Address','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_982">
<span><input style='text-align: left;width: auto;' id='mep_ev_982' type="checkbox" name='mep_reg_phone' <?php if(array_key_exists('mep_reg_phone', $values)){ $sqi2 = $values['mep_reg_phone'][0];}else{$sqi2=0;} if($sqi2==1){ echo 'checked'; } ?> value='1' /> <?php _e('Phone Number','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_983">
<span><input style='text-align: left;width: auto;' id='mep_ev_983' type="checkbox" name='mep_reg_address' <?php if(array_key_exists('mep_reg_address', $values)){ $sqi3 = $values['mep_reg_address'][0];}else{$sqi3=0;} if($sqi3==1){ echo 'checked'; } ?> value='1' /><?php _e('Address','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_98309">
<span><input style='text-align: left;width: auto;' id='mep_ev_98309' type="checkbox" name='mep_reg_tshirtsize' <?php if(array_key_exists('mep_reg_tshirtsize', $values)){ $sqi312 = $values['mep_reg_tshirtsize'][0]; }else{$sqi312=0;} if($sqi312==1){ echo 'checked'; } ?> value='1' /><?php _e('T-Shirt Size','mage-eventpress'); ?> </span></label>
</label>
<label for="">
<?php _e('Input Tshirts size, separetd by comma (M,L,XL)','mage-eventpress'); ?>
<?php
if(array_key_exists('mep_reg_tshirtsize', $values)){ $tsizes = $values['mep_reg_tshirtsize_list'][0]; }else{$tsizes='';}
?>
<input style='' id='' type="text" name='mep_reg_tshirtsize_list' value='<?php if($tsizes){ echo $tsizes; }else{ echo "S,M,L,XL"; } ?>' />
</label>
</div>
<div class='sec'>
<label for="mep_ev_984">
<span><input style='text-align: left;width: auto;' id='mep_ev_984' type="checkbox" name='mep_reg_designation' <?php if(array_key_exists('mep_reg_designation', $values)){ $sqi4 = $values['mep_reg_designation'][0]; }else{$sqi4=0;} if($sqi4==1){ echo 'checked'; } ?> value='1' /> <?php _e('Designation','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_985">
<span><input style='text-align: left;width: auto;' id='mep_ev_985' type="checkbox" name='mep_reg_website' <?php if(array_key_exists('mep_reg_website', $values)){ $sqi5 = $values['mep_reg_website'][0]; }else{$sqi5=0;} if($sqi5==1){ echo 'checked'; } ?> value='1' /> <?php _e('Website','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_986">
<span><input style='text-align: left;width: auto;' id='mep_ev_986' type="checkbox" name='mep_reg_veg' <?php if(array_key_exists('mep_reg_veg', $values)){ $sqi6 = $values['mep_reg_veg'][0];}else{$sqi6=0; } if($sqi6==1){ echo 'checked'; } ?> value='1' /> <?php _e('Vegetarian','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_987">
<span><input style='text-align: left;width: auto;' id='mep_ev_987' type="checkbox" name='mep_reg_company' <?php if(array_key_exists('mep_reg_company', $values)){ $sqi7 = $values['mep_reg_company'][0]; }else{ $sqi7=0; } if($sqi7==1){ echo 'checked'; } ?> value='1' /> <?php _e('Company Name','mage-eventpress'); ?> </span></label>
</div>
<div class='sec'>
<label for="mep_ev_988">
<span><input style='text-align: left;width: auto;' id='mep_ev_988' type="checkbox" name='mep_reg_gender' <?php if(array_key_exists('mep_reg_gender', $values)){ $sqi8 = $values['mep_reg_gender'][0]; }else{$sqi8=0;} if($sqi8==1){ echo 'checked'; } ?> value='1' /> <?php _e('Gender','mage-eventpress'); ?> </span></label>
</div>
<?php
do_action('mep_after_reg_form');
}
function mep_event_template_meta_box_cb($post){
@ -933,8 +868,8 @@ if($post){
$update_reg_name = update_post_meta( $pid, 'mep_full_name', $mep_full_name);
$update_reg_email = update_post_meta( $pid, 'mep_reg_email', $mep_reg_email);
$update_reg_name = update_post_meta( $pid, 'mep_full_name', $mep_full_name);
$update_reg_email = update_post_meta( $pid, 'mep_reg_email', $mep_reg_email);
$update_reg_phone = update_post_meta( $pid, 'mep_reg_phone', $mep_reg_phone);
$update_reg_address = update_post_meta( $pid, 'mep_reg_address', $mep_reg_address);
$update_reg_desg = update_post_meta( $pid, 'mep_reg_designation', $mep_reg_designation);
@ -943,9 +878,8 @@ $update_reg_veg = update_post_meta( $pid, 'mep_reg_veg', $mep_reg_veg);
$update_reg_comapny = update_post_meta( $pid, 'mep_reg_company', $mep_reg_company);
$update_reg_gender = update_post_meta( $pid, 'mep_reg_gender', $mep_reg_gender);
$update_tshirtsize = update_post_meta( $pid, 'mep_reg_tshirtsize', $mep_reg_tshirtsize);
$update_virtual = update_post_meta( $pid, '_virtual', 'yes');
$mep_reg_tshirtsize_list = update_post_meta( $pid, 'mep_reg_tshirtsize_list', $mep_reg_tshirtsize_list);
$update_template = update_post_meta( $pid, 'mep_event_template', $mep_event_template);
$update_template = update_post_meta( $pid, 'mep_event_template', $mep_event_template);
@ -995,6 +929,7 @@ $sts_msg = update_post_meta( $pid, '_stock_msg', 'new');
$update_price_label = update_post_meta( $pid, 'mep_price_label', $mep_price_label);
$update_price = update_post_meta( $pid, '_price', $_price);
$update_start = update_post_meta( $pid, 'mep_event_start_date', $mep_event_start_date);
$update_virtual = update_post_meta( $pid, '_virtual', 'yes');
$update_end = update_post_meta( $pid, 'mep_event_end_date', $mep_event_end_date);
$mep_event_cc_email_text = update_post_meta( $pid, 'mep_event_cc_email_text', $mep_event_cc_email_text);
}

View File

@ -246,7 +246,7 @@ if (is_array($mep_events_extra_prices) || is_object($mep_events_extra_prices)){
foreach ( $mep_events_extra_prices as $field ) {
if($field['option_qty']>0){
$item->add_meta_data( __( esc_attr( $field['option_name'] )." x ".$field['option_qty'], 'atn' ), get_woocommerce_currency_symbol().($field['option_qty'] *$field['option_price'] ) );
$item->add_meta_data(esc_attr( $field['option_name'] )." x ".$field['option_qty'], get_woocommerce_currency_symbol().($field['option_qty'] *$field['option_price'] ) );
$opt_name = $product_id.str_replace(' ', '', $field['option_name']);
@ -265,7 +265,7 @@ update_post_meta( $product_id, "mep_xtra_$opt_name",$ntes);
if($event_ticket_type){
$event_ticket_type = "Ticket:".$event_ticket_type;
$item->add_meta_data( __($event_ticket_type." x ".$event_ticket_qty),get_woocommerce_currency_symbol().$event_ticket_price);
$item->add_meta_data( $event_ticket_type." x ".$event_ticket_qty,get_woocommerce_currency_symbol().$event_ticket_price);
$tck_name = $product_id.str_replace(' ', '', $event_ticket_type);
$tesqt = get_post_meta($product_id,"mep_xtra_$tck_name",true);
$ntesqt = ($tesqt+$event_ticket_qty);
@ -273,7 +273,7 @@ update_post_meta( $product_id, "mep_xtra_$tck_name",$ntesqt);
}
$item->add_meta_data( __('_event_user_info'),$event_user_info);
$item->add_meta_data('_event_user_info',$event_user_info);

View File

@ -148,7 +148,7 @@ jQuery('#eventpxtp_<?php echo $count; ?>').on('change', function () {
jQuery('#dadainfo_<?php echo $count; ?>').append(
jQuery('<div/>')
.attr("id", "newDiv" + i)
.html("<div class='mep-user-info-sec'><h5><?php echo $qm; ?> <?php _e('Attendee info:','mage-eventpress'); ?>"+i+"</h5><input type='<?php if($mep_full_name){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_full_name){ ?> required='required' <?php } ?> name='user_name[]' class='mep_input' placeholder='<?php _e('Enter Your Name','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_email){ echo 'email'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_email){ ?> required='required' <?php } ?> name='user_email[]' class='mep_input' placeholder='<?php _e('Enter Your Email','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_phone){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_phone){ ?> required='required' <?php } ?> name='user_phone[]' class='mep_input' placeholder='<?php _e('Enter Your Phone','mage-eventpress'); ?>'/><textarea name='user_address[]' class='mep_input <?php if($mep_reg_address){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' rows='3' <?php if($mep_reg_address){ ?> required='required' <?php } ?> placeholder='<?php _e('Enter you address','mage-eventpress'); ?>'></textarea><label class='<?php if($mep_reg_tshirtsize){ echo "mep-show"; }else{ echo "mep-hidden"; } ?>' for='gen' style='text-align: left;'><?php _e('T-Shirt Size','mage-eventpress'); ?><select name='tshirtsize[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><?php echo mep_get_tshirts_sizes($post->ID); ?></select></label><label class='<?php if($mep_reg_gender){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='gen' style='text-align: left;'><?php _e('Gender','mage-eventpress'); ?><select name='gender[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Male'><?php _e('Male','mage-eventpress'); ?></option><option value='Female'><?php _e('Female','mage-eventpress'); ?></option></select></label><input type='<?php if($mep_reg_company){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_company[]' class='mep_input' placeholder='<?php _e('Company','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_designation){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_designation[]' class='mep_input' placeholder='<?php _e('Designation','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_website){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_website[]' class='mep_input' placeholder='<?php _e('Website','mage-eventpress'); ?>'/><label class='<?php if($mep_reg_veg){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='veg' style='text-align: left;'><?php _e('Vegetarian','mage-eventpress'); ?><select name='vegetarian[]' id='veg'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Yes'><?php _e('Yes','mage-eventpress'); ?></option><option value='No'><?php _e('No','mage-eventpress'); ?></option></select></label><input type='hidden' name='ticket_type[]' class='mep_input' value='<?php echo $qm; ?>' /><?php do_action('mep_after_reg_form_front'); ?>")
.html("<?php do_action('mep_reg_fields'); ?>")
);
}
@ -175,7 +175,7 @@ jQuery('#quantity_5a7abbd1bff73').on('change', function () {
jQuery('#divParent').append(
jQuery('<div/>')
.attr("id", "newDiv" + i)
.html("<div class='mep-user-info-sec'><h5><?php echo $qm; ?> <?php _e('Attendee info:','mage-eventpress'); ?>"+i+"</h5><input type='<?php if($mep_full_name){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_full_name){ ?> required='required' <?php } ?> name='user_name[]' class='mep_input' placeholder='<?php _e('Enter Your Name','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_email){ echo 'email'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_email){ ?> required='required' <?php } ?> name='user_email[]' class='mep_input' placeholder='<?php _e('Enter Your Email','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_phone){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_phone){ ?> required='required' <?php } ?> name='user_phone[]' class='mep_input' placeholder='<?php _e('Enter Your Phone','mage-eventpress'); ?>'/><textarea name='user_address[]' class='mep_input <?php if($mep_reg_address){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' rows='3' <?php if($mep_reg_address){ ?> required='required' <?php } ?> placeholder='<?php _e('Enter you address','mage-eventpress'); ?>'></textarea><label class='<?php if($mep_reg_tshirtsize){ echo "mep-show"; }else{ echo "mep-hidden"; } ?>' for='gen' style='text-align: left;'><?php _e('T-Shirt Size','mage-eventpress'); ?><select name='tshirtsize[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><?php echo mep_get_tshirts_sizes($post->ID); ?></select></label><label class='<?php if($mep_reg_gender){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='gen' style='text-align: left;'><?php _e('Gender','mage-eventpress'); ?><select name='gender[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Male'><?php _e('Male','mage-eventpress'); ?></option><option value='Female'><?php _e('Female','mage-eventpress'); ?></option></select></label><input type='<?php if($mep_reg_company){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_company[]' class='mep_input' placeholder='<?php _e('Company','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_designation){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_designation[]' class='mep_input' placeholder='<?php _e('Designation','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_website){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_website[]' class='mep_input' placeholder='<?php _e('Website','mage-eventpress'); ?>'/><label class='<?php if($mep_reg_veg){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='veg' style='text-align: left;'><?php _e('Vegetarian','mage-eventpress'); ?><select name='vegetarian[]' id='veg'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Yes'><?php _e('Yes','mage-eventpress'); ?></option><option value='No'><?php _e('No','mage-eventpress'); ?></option></select></label><input type='hidden' name='ticket_type[]' class='mep_input' value='<?php echo $qm; ?>' /><?php do_action('mep_after_reg_form_front'); ?>")
.html("<?php do_action('mep_reg_fields'); ?>")
);
}

View File

@ -122,10 +122,7 @@ $mep_event_ticket_type = get_post_meta($post->ID, 'mep_event_ticket_type', true)
if(!$mep_event_ticket_type){
if($qm){$qm=$qm;}else{$qm='';}
?>
<div class="user-info-sec">
<div id="divParent"><div class='mep-user-info-sec'><h5><?php echo $qm; ?> <?php _e('Attendee info','mage-eventpress'); ?>:1</h5><input type='<?php if($mep_full_name){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_full_name){ ?> required='required' <?php } ?> name='user_name[]' class='mep_input' placeholder='<?php _e('Enter Your Name','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_email){ echo 'email'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_email){ ?> required='required' <?php } ?> name='user_email[]' class='mep_input' placeholder='<?php _e('Enter Your Email','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_phone){ echo 'text'; }else{ echo 'hidden'; } ?>' <?php if($mep_reg_phone){ ?> required='required' <?php } ?> name='user_phone[]' class='mep_input' placeholder='<?php _e('Enter Your Phone','mage-eventpress'); ?>'/><textarea name='user_address[]' class='mep_input <?php if($mep_reg_address){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' rows='3' <?php if($mep_reg_address){ ?> required='required' <?php } ?> placeholder='<?php _e('Enter you address','mage-eventpress'); ?>'></textarea><label class='<?php if($mep_reg_tshirtsize){ echo "mep-show"; }else{ echo "mep-hidden"; } ?>' for='gen' style='text-align: left;'><?php _e('T-Shirt Size','mage-eventpress'); ?><select name='tshirtsize[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><?php echo mep_get_tshirts_sizes($post->ID); ?></select></label><label class='<?php if($mep_reg_gender){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='gen' style='text-align: left;'><?php _e('Gender','mage-eventpress'); ?><select name='gender[]' id='gen'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Male'><?php _e('Male','mage-eventpress'); ?></option><option value='Female'><?php _e('Female','mage-eventpress'); ?></option></select></label><input type='<?php if($mep_reg_company){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_company[]' class='mep_input' placeholder='<?php _e('Company','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_designation){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_designation[]' class='mep_input' placeholder='<?php _e('Designation','mage-eventpress'); ?>'/><input type='<?php if($mep_reg_website){ echo 'text'; }else{ echo 'hidden'; } ?>' name='user_website[]' class='mep_input' placeholder='<?php _e('Website','mage-eventpress'); ?>'/><label class='<?php if($mep_reg_veg){ echo 'mep-show'; }else{ echo 'mep-hidden'; } ?>' for='veg' style='text-align: left;'><?php _e('Vegetarian','mage-eventpress'); ?><select name='vegetarian[]' id='veg'><option value=''><?php _e('Please Select','mage-eventpress'); ?></option><option value='Yes'><?php _e('Yes','mage-eventpress'); ?></option><option value='No'><?php _e('No','mage-eventpress'); ?></option></select></label><input type='hidden' name='ticket_type[]' class='mep_input' value='<?php echo $qm; ?>' /><?php do_action('mep_after_reg_form_front'); ?></div>
</div>
</div>
<?php do_action('mep_reg_fields'); ?>
<?php } ?>

View File

@ -3,7 +3,7 @@
* Plugin Name: Woocommerce Events Manager
* Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 2.1.7
* Version: 2.1.8
* Author: MagePeople Team
* Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress
@ -168,119 +168,6 @@ $site_name = get_option( 'blogname' );
}
}
// Get user information and save to attendee list after order confirmation
add_action( 'woocommerce_order_status_completed_notification', 'mep_set_event_attendee_data' );
function mep_set_event_attendee_data( $order_id ) {
if ( ! $order_id )
return;
// Getting an instance of the order object
$order = wc_get_order( $order_id );
$order_meta = get_post_meta($order_id);
$order_meta_text = "_stock_msg_".$order_id;
$order_processing = "processing_".$order_id;
$order_completed = "completed_".$order_id;
$order_cancelled = "cancelled_".$order_id;
# Iterating through each order items (WC_Order_Item_Product objects in WC 3+)
foreach ( $order->get_items() as $item_id => $item_values ) {
$product_id = $item_values->get_product_id();
$item_data = $item_values->get_data();
$product_id = $item_data['product_id'];
$item_quantity = $item_values->get_quantity();
$product = get_page_by_title( $item_data['name'], OBJECT, 'mep_events' );
$event_name = $item_data['name'];
$event_id = $product->ID;
$item_id = $item_id;
}
$user_info_arr = wc_get_order_item_meta($item_id,'_event_user_info',true);
$first_name = $order_meta['_billing_first_name'][0];
$last_name = $order_meta['_billing_last_name'][0];
$company_name = $order_meta['_billing_company'][0];
$address_1 = $order_meta['_billing_address_1'][0];
$address_2 = $order_meta['_billing_address_2'][0];
$city = $order_meta['_billing_city'][0];
$state = $order_meta['_billing_state'][0];
$postcode = $order_meta['_billing_postcode'][0];
$country = $order_meta['_billing_country'][0];
$email = $order_meta['_billing_email'][0];
$phone = $order_meta['_billing_phone'][0];
$billing_intotal = $order_meta['_billing_address_index'][0];
$payment_method = $order_meta['_payment_method_title'][0];
$user_id = $order_meta['_customer_user'][0];
$mep_atnd = "_mep_atnd_".$order_id;
$mep_stock_msgc = get_post_meta($event_id,$mep_atnd, true);
mep_event_confirmation_email_sent($event_id,$email);
if($mep_stock_msgc!='a2'){
foreach ($user_info_arr as $_user_info) {
$uname = $_user_info['user_name'];
$email = $_user_info['user_email'];
$phone = $_user_info['user_phone'];
$address = $_user_info['user_address'];
$gender = $_user_info['user_gender'];
$company = $_user_info['user_company'];
$designation = $_user_info['user_designation'];
$website = $_user_info['user_website'];
$vegetarian = $_user_info['user_vegetarian'];
$tshirtsize = $_user_info['user_tshirtsize'];
$ticket_type = $_user_info['user_ticket_type'];
$mep_ucf = $_user_info['mep_ucf'];
// ADD THE FORM INPUT TO $new_post ARRAY
$new_post = array(
'post_title' => $uname,
'post_content' => '',
'post_category' => array(), // Usable for custom taxonomies too
'tags_input' => array(),
'post_status' => 'publish', // Choose: publish, preview, future, draft, etc.
'post_type' => 'mep_events_attendees' //'post',page' or use a custom post type if you want to
);
//SAVE THE POST
$pid = wp_insert_post($new_post);
$update_fname = update_post_meta( $pid, 'ea_name', $uname);
$update_uid = update_post_meta( $pid, 'ea_user_id', $user_id);
$update_ad1 = update_post_meta( $pid, 'ea_address_1', $address);
$update_email = update_post_meta( $pid, 'ea_email', $email);
$update_phone = update_post_meta( $pid, 'ea_phone', $phone);
$update_gender = update_post_meta( $pid, 'ea_gender', $gender);
$update_company = update_post_meta( $pid, 'ea_company', $company);
$update_desg = update_post_meta( $pid, 'ea_desg', $designation);
$update_web = update_post_meta( $pid, 'ea_website', $website);
$update_veg = update_post_meta( $pid, 'ea_vegetarian', $vegetarian);
$update_teesize = update_post_meta( $pid, 'ea_tshirtsize', $tshirtsize);
$update_ticket_type = update_post_meta( $pid, 'ea_ticket_type', $ticket_type);
$update_pym = update_post_meta( $pid, 'ea_payment_method', $payment_method);
$update_event_name = update_post_meta( $pid, 'ea_event_name', $event_name);
$update_eid = update_post_meta( $pid, 'ea_event_id', $event_id);
$update_oid = update_post_meta( $pid, 'ea_order_id', $order_id);
// Checking if the form builder addon is active and have any custom fields
$mep_form_builder_data = get_post_meta($event_id, 'mep_form_builder_data', true);
if ( $mep_form_builder_data ) {
foreach ( $mep_form_builder_data as $_field ) {
update_post_meta( $pid, "ea_".$_field['mep_fbc_id'], $_user_info[$_field['mep_fbc_id']]);
}
}
}
}
}
}
@ -543,32 +430,12 @@ function mep_attendee_filter_query($query) {
}
add_filter( 'post_row_actions', 'mep_remove_row_actions', 10, 1 );
function mep_remove_row_actions( $actions )
{
if( get_post_type() === 'mep_events_attendees' )
// unset( $actions['edit'] );
// unset( $actions['view'] );
unset( $actions['trash'] );
unset( $actions['inline hide-if-no-js'] );
return $actions;
}
// Add the custom columns to the book post type:
add_filter( 'manage_mep_events_posts_columns', 'mep_set_custom_edit_event_columns' );
function mep_set_custom_edit_event_columns($columns) {
unset( $columns['date'] );
$columns['mep_status'] = __( 'Status', 'mage-eventpress' );
$columns['mep_atten'] = __( 'Attendees', 'mage-eventpress' );
return $columns;
}
// Add the data to the custom columns for the book post type:
@ -624,84 +491,6 @@ function mep_event_redirect_to_checkout() {
// Add the custom columns to the book post type:
add_filter( 'manage_mep_events_attendees_posts_columns', 'mep_set_custom_events_attendees_columns' );
function mep_set_custom_events_attendees_columns($columns) {
unset( $columns['title'] );
unset( $columns['date'] );
$columns['mep_uid'] = __( 'Unique ID', 'mepevvent' );
$columns['mep_fn'] = __( 'Full Name', 'mage-eventpress' );
// $columns['mep_email'] = __( 'email', 'mep' );
// $columns['mep_phone'] = __( 'Phone', 'mep' );
// $columns['mep_address'] = __( 'Addresss', 'mep' );
// $columns['mep_tsize'] = __( 'Tee Size', 'mep' );
$columns['mep_ttype'] = __( 'Ticket', 'mage-eventpress' );
$columns['mep_evnt'] = __( 'Event', 'mage-eventpress' );
return $columns;
}
// Add the data to the custom columns for the book post type:
add_action( 'manage_mep_events_attendees_posts_custom_column' , 'mep_events_attendees_column', 10, 2 );
function mep_events_attendees_column( $column, $post_id ) {
switch ( $column ) {
case 'mep_uid' :
echo get_post_meta( $post_id, 'ea_user_id', true ).get_post_meta( $post_id, 'ea_order_id', true ).$post_id;
break;
case 'mep_fn' :
echo get_post_meta( $post_id, 'ea_name', true );
break;
case 'mep_email' :
echo get_post_meta( $post_id, 'ea_email', true );
break;
case 'mep_phone' :
echo get_post_meta( $post_id, 'ea_phone', true );
break;
case 'mep_tsize' :
echo get_post_meta( $post_id, 'ea_tshirtsize', true );
break;
case 'mep_address' :
echo get_post_meta( $post_id, 'ea_address_1', true )."<br/>".get_post_meta( $post_id, 'ea_address_2', true )."<br/>".get_post_meta( $post_id, 'ea_state', true ).", ".get_post_meta( $post_id, 'ea_city', true ).", ".get_post_meta( $post_id, 'ea_country', true );
break;
case 'mep_ttype' :
echo get_post_meta( $post_id, 'ea_ticket_type', true );
break;
case 'mep_evnt' :
echo get_post_meta( $post_id, 'ea_event_name', true );
break;
case 'mep_atten' :
echo '<a class="button button-primary button-large" href="'.get_site_url().'/wp-admin/edit.php?post_type=mep_events_attendees&meta_value='.$post_id.'">Attendees List</a>';
break;
}
}
function mep_disable_new_posts() {
// Hide sidebar link
global $submenu;
unset($submenu['edit.php?post_type=mep_events_attendees'][10]);
// // Hide link on listing page
if (isset($_GET['post_type']) && $_GET['post_type'] == 'mep_events_attendees') {
echo '<style type="text/css">
#favorite-actions, .add-new-h2, .tablenav, .page-title-action { display:none; }
</style>';
}
}
add_action('admin_menu', 'mep_disable_new_posts');
function mep_load_events_templates($template) {
global $post;
@ -1053,4 +842,15 @@ return $gn_price;
function mep_get_label($pid,$label_id,$default_text){
return mep_get_option( $label_id, 'label_setting_sec', $default_text);
}
// Add the custom columns to the book post type:
add_filter( 'manage_mep_events_posts_columns', 'mep_set_custom_edit_event_columns' );
function mep_set_custom_edit_event_columns($columns) {
unset( $columns['date'] );
$columns['mep_status'] = __( 'Status', 'mage-eventpress' );
return $columns;
}