diff --git a/woocommerce-event-press.php b/woocommerce-event-press.php index 8ee9f79..5f47631 100644 --- a/woocommerce-event-press.php +++ b/woocommerce-event-press.php @@ -891,19 +891,24 @@ function mep_attendee_filter_query($query) { $q_vars['meta_key'] = 'ea_event_id'; $q_vars['meta_value'] = $_GET['meta_value']; - } - - - - - - if ( $pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == $post_type && isset($_GET['event_id']) && $_GET['event_id'] != 0 ) { - - $q_vars['meta_key'] = 'ea_event_id'; - $q_vars['meta_value'] = $_GET['event_id']; - - $q_vars['meta_key'] = 'ea_event_date'; - $q_vars['meta_value'] = $_GET['ea_event_date']; + }elseif ( $pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == $post_type && isset($_GET['event_id']) && $_GET['event_id'] != 0 && !isset($_GET['action']) ) { + + $event_date = date('Y-m-d',strtotime($_GET['ea_event_date'])); + $meta_query = array([ + 'key' => 'ea_event_id', + 'value' => $_GET['event_id'], + 'compare' => '=' + ],[ + 'key' => 'ea_event_date', + 'value' => $event_date, + 'compare' => 'LIKE' + ],[ + 'key' => 'ea_order_status', + 'value' => 'completed', + 'compare' => '=' + ]); + + $query->set( 'meta_query', $meta_query ); } } @@ -940,6 +945,7 @@ switch ( $column ) { $multi_date = get_post_meta($post_id,'mep_event_more_date',true) ? get_post_meta($post_id,'mep_event_more_date',true) : array(); $recurring = get_post_meta($post_id, 'mep_enable_recurring', true) ? get_post_meta($post_id, 'mep_enable_recurring', true) : 'no'; // print_r($multi_date); + // if($recurring == 'yes'){ ?>