version 3.9.4 release

This commit is contained in:
magepeopleteam 2023-05-30 07:03:29 +00:00
parent bd0ce6ef2e
commit 73872bf91b
5 changed files with 69 additions and 94 deletions

View File

@ -2522,7 +2522,7 @@ if (!function_exists('mep_mep_events_column')) {
$more_date = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array(); $more_date = get_post_meta($post_id, 'mep_event_more_date', true) ? get_post_meta($post_id, 'mep_event_more_date', true) : array();
$event_more_dates = is_array($more_date) && sizeof($more_date) > 0 ? count($more_date) + 1 : ''; $event_more_dates = is_array($more_date) && sizeof($more_date) > 0 ? count($more_date) + 1 : '';
echo mep_get_event_total_seat($post_id, $event_more_dates, 'multi'); echo apply_filters( 'mep_attendee_stat_recurring', mep_get_event_total_seat($post_id, $event_more_dates, 'multi'),$post_id);
} else { } else {
echo mep_get_event_total_seat($post_id); echo mep_get_event_total_seat($post_id);
} }
@ -3015,8 +3015,7 @@ if (!function_exists('mep_wc_link_product_on_save')) {
add_action('admin_head', 'mep_hide_date_from_order_page'); add_action('admin_head', 'mep_hide_date_from_order_page');
if (!function_exists('mep_hide_date_from_order_page')) { if (!function_exists('mep_hide_date_from_order_page')) {
function mep_hide_date_from_order_page() {
function mep_hide_date_from_order_page() {
$product_id = []; $product_id = [];
$hide_wc = mep_get_option('mep_show_hidden_wc_product', 'general_setting_sec', 'no'); $hide_wc = mep_get_option('mep_show_hidden_wc_product', 'general_setting_sec', 'no');
$args = array( $args = array(
@ -3030,11 +3029,10 @@ function mep_hide_date_from_order_page() {
} }
$product_id = array_filter($product_id); $product_id = array_filter($product_id);
$parr = implode(', ', $product_id); $parr = implode(', ', $product_id);
if($hide_wc == 'no'){ if($hide_wc == 'no'){
echo '<style> ' . esc_html($parr) . '{display:none!important}' . ' </style>'; echo '<style> ' . esc_html($parr) . '{display:none!important}' . ' </style>';
} }
} }
} }
add_action('init','mep_get_all_hidden_product_id_array'); add_action('init','mep_get_all_hidden_product_id_array');
@ -3052,15 +3050,10 @@ function mep_get_all_hidden_product_id_array() {
$product_id = array_filter($product_id); $product_id = array_filter($product_id);
return $product_id; return $product_id;
} }
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'mep_get_all_hidden_product_id_array' ); add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', 'mep_get_all_hidden_product_id_array' );
// add_action('parse_query', 'mep_product_tags_sorting_query'); // add_action('parse_query', 'mep_product_tags_sorting_query');
if (!function_exists('mep_product_tags_sorting_query')) { if (!function_exists('mep_product_tags_sorting_query')) {
function mep_product_tags_sorting_query($query) { function mep_product_tags_sorting_query($query) {
@ -4722,28 +4715,23 @@ function mep_location_existis($meta_name, $event_id) {
* Functions Dev by @Ariful * Functions Dev by @Ariful
**************************/ **************************/
if (!function_exists('mep_elementor_get_events')) { if (!function_exists('mep_elementor_get_events')) {
function mep_elementor_get_events($default) { function mep_elementor_get_events($default) {
$args = array('post_type' => 'mep_events',); $args = array('post_type' => 'mep_events',);
$list = array('0' => $default); $list = array('0' => $default);
$the_query = new WP_Query($args); $the_query = new WP_Query($args);
if ($the_query->have_posts()) { if ($the_query->have_posts()) {
while ($the_query->have_posts()) { while ($the_query->have_posts()) {
$the_query->the_post(); $the_query->the_post();
$list[get_the_id()] = get_the_title(); $list[get_the_id()] = get_the_title();
} }
} }
wp_reset_postdata(); wp_reset_postdata();
return $list; return $list;
} }
} }
if (!function_exists('mep_get_list_thumbnail_src')) { if (!function_exists('mep_get_list_thumbnail_src')) {
function mep_get_list_thumbnail_src($event_id,$size='full') { function mep_get_list_thumbnail_src($event_id,$size='full') {
$thumbnail_id = get_post_meta($event_id, 'mep_list_thumbnail', true) ? get_post_meta($event_id, 'mep_list_thumbnail', true) : 0; $thumbnail_id = get_post_meta($event_id, 'mep_list_thumbnail', true) ? get_post_meta($event_id, 'mep_list_thumbnail', true) : 0;
@ -4754,15 +4742,13 @@ function mep_get_list_thumbnail_src($event_id,$size='full') {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size); $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($event_id), $size);
echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : ''); echo esc_attr(is_array($thumbnail) && sizeof($thumbnail) > 0 ? $thumbnail[0] : '');
} }
} }
} }
add_filter('mep_check_product_into_cart', 'mep_disable_add_to_cart_if_product_is_in_cart', 10, 2); add_filter('mep_check_product_into_cart', 'mep_disable_add_to_cart_if_product_is_in_cart', 10, 2);
if (!function_exists('mep_disable_add_to_cart_if_product_is_in_cart')) { if (!function_exists('mep_disable_add_to_cart_if_product_is_in_cart')) {
function mep_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product) { function mep_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product) {
// Loop through cart items checking if the product is already in cart // Loop through cart items checking if the product is already in cart
if (isset(WC()->cart) && !is_admin() && !empty(WC()->cart->get_cart())) { if (isset(WC()->cart) && !is_admin() && !empty(WC()->cart->get_cart())) {
foreach (WC()->cart->get_cart() as $cart_item) { foreach (WC()->cart->get_cart() as $cart_item) {
@ -4772,11 +4758,11 @@ function mep_disable_add_to_cart_if_product_is_in_cart($is_purchasable, $product
} }
} }
return $is_purchasable; return $is_purchasable;
} }
} }
if (!function_exists('mep_get_default_lang_event_id')) { if (!function_exists('mep_get_default_lang_event_id')) {
function mep_get_default_lang_event_id($event_id) { function mep_get_default_lang_event_id($event_id) {
global $sitepress; global $sitepress;
$multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none'); $multi_lang_plugin = mep_get_option('mep_multi_lang_plugin', 'general_setting_sec', 'none');
@ -4790,18 +4776,12 @@ function mep_get_default_lang_event_id($event_id) {
// WPML // WPML
$default_language = function_exists('wpml_loaded') ? $sitepress->get_default_language() : get_locale(); // will return 'en' $default_language = function_exists('wpml_loaded') ? $sitepress->get_default_language() : get_locale(); // will return 'en'
$event_id = apply_filters('wpml_object_id', $event_id, 'mep_events', TRUE, $default_language); $event_id = apply_filters('wpml_object_id', $event_id, 'mep_events', TRUE, $default_language);
} else { } else {
$event_id = $event_id; $event_id = $event_id;
} }
return $event_id; return $event_id;
}
} }
}
/** /**

View File

@ -175,7 +175,7 @@ if (!function_exists('mep_get_event_reg_btn')) {
<?php }if($not_in_the_cart){ ?> <?php }if($not_in_the_cart){ ?>
<button type="submit" name="add-to-cart" value="<?php echo esc_attr($cart_product_id); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php do_action('mep_before_add_cart_button',$post_id); echo "<span class='mep-cart-btn-text'>".esc_html($cart_btn_label)."</span>"; do_action('mep_after_add_cart_button',$post_id); ?></button> <button type="submit" name="add-to-cart" value="<?php echo esc_attr($cart_product_id); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php do_action('mep_before_add_cart_button',$post_id); echo "<span class='mep-cart-btn-text'>".esc_html($cart_btn_label)."</span>"; do_action('mep_after_add_cart_button',$post_id); ?></button>
<?php }else{ ?> <?php }else{ ?>
<a href="<?php echo wc_get_cart_url(); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php esc_html_e('You"ve already added this item to your cart! View your cart to continue shopping or checkout now.', 'mage-eventpress'); ?> </a> <a href="<?php echo wc_get_cart_url(); ?>" class="button-default woocommerce button alt button alt btn-mep-event-cart"><?php esc_html_e('You have already added this item to your cart! View your cart to continue shopping or checkout now.', 'mage-eventpress'); ?> </a>
<?php } ?> <?php } ?>
<?php do_action('mep_after_add_cart_btn',$post_id); ?> <?php do_action('mep_after_add_cart_btn',$post_id); ?>
</td> </td>

View File

@ -196,7 +196,8 @@ if (!function_exists('mep_ev_date')) {
} }
} else { } else {
?> ?>
<p><?php echo apply_filters('mep_display_date_only',get_mep_datetime($start_datetime, 'date-text'),$event_id); ?></p> <p><?php
echo apply_filters('mep_display_date_only',get_mep_datetime($start_datetime, 'date-text'),$event_id); ?></p>
<?php <?php
} }
} }

View File

@ -12,7 +12,6 @@ if (!function_exists('mep_event_ticket_type_loop_list_html')) {
$event_order_by = mep_get_option('mep_event_list_order_by', 'general_setting_sec', 'meta_value'); $event_order_by = mep_get_option('mep_event_list_order_by', 'general_setting_sec', 'meta_value');
$event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old; $event_expire_on = $event_expire_on_old == 'event_end_datetime' ? 'event_expire_datetime' : $event_expire_on_old;
$mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on'; $mep_available_seat = get_post_meta($post_id, 'mep_available_seat', true) ? get_post_meta($post_id, 'mep_available_seat', true) : 'on';
$mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array(); $mep_event_ticket_type = get_post_meta($post_id, 'mep_event_ticket_type', true) ? get_post_meta($post_id, 'mep_event_ticket_type', true) : array();
ob_start(); ob_start();
@ -49,17 +48,12 @@ if (!function_exists('mep_event_ticket_type_loop_list_html')) {
$event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true); $event_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
$event_start_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true); $event_start_date = get_post_meta($post_id, 'event_start_date', true) . ' ' . get_post_meta($post_id, 'event_start_time', true);
// $total_sold = (int) mep_ticket_type_sold($post_id, $ticket_type_name, $event_date); // $total_sold = (int) mep_ticket_type_sold($post_id, $ticket_type_name, $event_date);
$total_sold = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity); $total_sold = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity);
$total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity); $total_tickets = (int) $total_quantity - ((int) $total_sold + (int) $total_resv_quantity);
// $total_tickets = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity); // $total_tickets = mep_get_ticket_type_seat_count($post_id,$ticket_type_name,$event_date,$total_quantity,$total_resv_quantity);
$total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field, $event_date); $total_seats = apply_filters('mep_total_ticket_of_type', $total_tickets, $post_id, $field, $event_date);
$total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field); $total_min_seat = apply_filters('mep_ticket_min_qty', 0, $post_id, $field);
$default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field); $default_quantity = apply_filters('mep_ticket_default_qty', $default_qty, $post_id, $field);

View File

@ -3,7 +3,7 @@
* Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce * Plugin Name: Event Manager and Tickets Selling Plugin for WooCommerce
* Plugin URI: http://mage-people.com * Plugin URI: http://mage-people.com
* Description: A Complete Event Solution for WordPress by MagePeople.. * Description: A Complete Event Solution for WordPress by MagePeople..
* Version: 3.9.3 * Version: 3.9.4
* Author: MagePeople Team * Author: MagePeople Team
* Author URI: http://www.mage-people.com/ * Author URI: http://www.mage-people.com/
* Text Domain: mage-eventpress * Text Domain: mage-eventpress