From 104c253da107317dcd7d450b303ef1aa32da0f35 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Fri, 12 Mar 2021 10:19:31 +0000 Subject: [PATCH] func update --- inc/mep_extra_price.php | 10 +++++++++- inc/mep_functions.php | 40 ++++++++++++++++++++++++++++++---------- inc/mep_upgrade.php | 25 ++++++++++++++++++++----- 3 files changed, 59 insertions(+), 16 deletions(-) diff --git a/inc/mep_extra_price.php b/inc/mep_extra_price.php index c9c4cc9..c4596d9 100644 --- a/inc/mep_extra_price.php +++ b/inc/mep_extra_price.php @@ -225,8 +225,16 @@ function mep_add_custom_fields_text_to_order_items($item, $cart_item_key, $value $event_user_info = $form_position == 'details_page' ? $values['event_user_info'] : mep_save_attendee_info_into_cart($eid); $recurring = get_post_meta($eid, 'mep_enable_recurring', true) ? get_post_meta($eid, 'mep_enable_recurring', true) : 'no'; $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'; + - if ($recurring == 'yes') { + if($recurring == 'everyday' && $time_status == 'no'){ + if (is_array($ticket_type_arr) && sizeof($ticket_type_arr) > 0) { + foreach ($ticket_type_arr as $_event_recurring_date) { + $item->add_meta_data($date_text, get_mep_datetime($_event_recurring_date['event_date'], 'date-text')); + } + } + }elseif ($recurring == 'yes') { if (is_array($ticket_type_arr) && sizeof($ticket_type_arr) > 0) { foreach ($ticket_type_arr as $_event_recurring_date) { $item->add_meta_data($date_text, get_mep_datetime($_event_recurring_date['event_date'], 'date-time-text')); diff --git a/inc/mep_functions.php b/inc/mep_functions.php index 7169497..d209840 100755 --- a/inc/mep_functions.php +++ b/inc/mep_functions.php @@ -14,6 +14,10 @@ if (!function_exists('mep_language_load')) { } } +function mepfix_sitemap_exclude_post_type() { + return [ 'auto-draft' ]; +} + if (!function_exists('mep_get_builder_version')) { function mep_get_builder_version(){ if(is_plugin_active( 'woocommerce-event-manager-addon-form-builder/addon-builder.php' )){ @@ -635,14 +639,10 @@ function mep_delete_attandee_of_an_order($order_id,$event_id){ } - - - - - if (!function_exists('change_attandee_order_status')) { function change_attandee_order_status($order_id,$set_status,$post_status,$qr_status=null){ - + add_filter( 'wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5 ); + $args = array ( 'post_type' => array( 'mep_events_attendees' ), 'posts_per_page' => -1, @@ -670,7 +670,7 @@ if (!function_exists('change_attandee_order_status')) { if (!function_exists('change_extra_service_status')) { function change_extra_service_status($order_id,$set_status,$post_status,$qr_status=null){ - + add_filter( 'wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5 ); $args = array ( 'post_type' => array( 'mep_extra_service' ), 'posts_per_page' => -1, @@ -700,7 +700,7 @@ if (!function_exists('change_extra_service_status')) { if (!function_exists('change_wc_event_product_status')) { function change_wc_event_product_status($order_id,$set_status,$post_status,$qr_status=null){ - + add_filter( 'wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5 ); $args = array ( 'post_type' => array( 'product' ), 'posts_per_page' => -1, @@ -1913,6 +1913,7 @@ if (!function_exists('mep_get_event_total_seat')) { if (!function_exists('mep_reset_event_booking')) { function mep_reset_event_booking($event_id){ + add_filter( 'wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5 ); $mep_event_ticket_type = get_post_meta($event_id, 'mep_event_ticket_type', true); if($mep_event_ticket_type){ foreach ( $mep_event_ticket_type as $field ) { @@ -2288,10 +2289,21 @@ if (!function_exists('mep_on_post_publish')) { } } + + + + + + + + + + + add_action('save_post','mep_wc_link_product_on_save',99,1); if (!function_exists('mep_wc_link_product_on_save')) { function mep_wc_link_product_on_save($post_id){ - + add_filter( 'wpseo_public_post_statuses', 'mepfix_sitemap_exclude_post_type', 5 ); if (get_post_type($post_id) == 'mep_events') { if ( ! isset( $_POST['mep_event_reg_btn_nonce'] ) || @@ -2945,6 +2957,9 @@ if (!function_exists('mep_cart_display_user_list')) { function mep_cart_display_user_list($user_info,$event_id){ $custom_forms_id = mep_get_user_custom_field_ids($event_id); ob_start(); + $recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no'; + $time_status = get_post_meta($event_id, 'mep_disable_ticket_time', true) ? get_post_meta($event_id, 'mep_disable_ticket_time', true) : 'no'; + foreach ($user_info as $userinf) { // echo 123; ?> @@ -2977,7 +2992,12 @@ $custom_forms_id = mep_get_user_custom_field_ids($event_id); } } ?>
  • + + +
  • +
  • + '', ) ); } -add_action( 'widgets_init', 'mep_default_sidebar_reg' ); +add_action( 'widgets_init', 'mep_default_sidebar_reg' ); \ No newline at end of file diff --git a/inc/mep_upgrade.php b/inc/mep_upgrade.php index 3b9169c..56546a5 100644 --- a/inc/mep_upgrade.php +++ b/inc/mep_upgrade.php @@ -58,11 +58,31 @@ function mep_flash_permalink_once() add_action('admin_init', 'mep_flash_permalink_once'); + + + + add_action('admin_init', 'mep_get_all_order_data_and_create_attendee'); function mep_get_all_order_data_and_create_attendee() { + + + + + + + + + + + + + + + + if (get_option('mep_hidden_product_thumbnail_update_02') != 'completed') { $args = array( @@ -351,11 +371,6 @@ if (get_option('mep_attendee_price_update_2') != 'completed') { - - - - - }