Skip to content

Commit def2613

Browse files
committed
#1679 Disable registration (org issue solved)
1 parent 01bcfdd commit def2613

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

includes/wp-event-manager-ajax.php

+4-15
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,10 @@ public function get_listings() {
166166
if($events->have_posts()) : $result['found_events'] = true;
167167
while ($events->have_posts()) : $events->the_post();
168168

169-
// compare event registration limit and total registration of that event
170-
$registration_limit = get_post_meta( get_the_id(),'_registration_limit',true );
171-
$statuses_to_count = array('new', 'confirmed', 'waiting', 'cancelled', 'archived', 'publish');
172-
$registered_count = sizeof(get_posts(array(
173-
'post_type' => 'event_registration',
174-
'post_status' => $statuses_to_count,
175-
'posts_per_page' => -1,
176-
'fields' => 'ids',
177-
'post_parent' => get_the_id()
178-
)));
179-
// If event is fully registered then it will hide
180-
if ( $registration_limit && $registered_count && $registration_limit == $registered_count ) {
181-
$fully_registered_events++;
182-
continue;
183-
}
169+
$hide_event = apply_filters('wpem_hide_selected_event', false, get_the_id());
170+
if($hide_event == true){
171+
continue;
172+
}
184173
get_event_manager_template_part( 'content', 'event_listing' );
185174
endwhile;
186175
$events->found_posts -= $fully_registered_events;

shortcodes/wp-event-manager-shortcodes.php

+4
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ public function output_events($atts){
756756
wp_enqueue_script('wp-event-manager-ajax-filters');
757757
get_event_manager_template('event-listings-start.php', array('layout_type' => esc_attr( $layout_type ), 'title' => $title));
758758
while ($events->have_posts()) : $events->the_post();
759+
$hide_event = apply_filters('wpem_hide_selected_event', false, get_the_id());
760+
if($hide_event == true){
761+
continue;
762+
}
759763
get_event_manager_template_part('content', 'event_listing');
760764
endwhile;
761765
get_event_manager_template('event-listings-end.php', array('show_pagination' => $show_pagination, 'show_more' => $show_more, 'per_page' => $per_page, 'events' => $events, 'show_filters' => $show_filters));?>

0 commit comments

Comments
 (0)