Skip to content

Commit

Permalink
feat: add 'wpe/event_join_table' filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBan committed Mar 2, 2021
1 parent 7b4046d commit d43f17d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WPEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/matiere-noire/
Description: Gestion des événements
Author: Matière Noire
Version: 1.4.1
Version: 1.5.2
Author URI: https://github.com/matiere-noire/
Text Domain: mn-wp-events
Domain Path: /languages
Expand Down
5 changes: 3 additions & 2 deletions src/Classes/WPQueryEventsFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public function jointDateTable($join, $wp_query)
global $wpdb;

if ($this->isQueryEvents($wp_query)) {
$join .= " LEFT JOIN {$wpdb->wpe_dates} as wpe_dates on wpe_dates.wpe_event_id = {$wpdb->posts}.ID ";
$leftJoin = apply_filters('wpe/event_join_table', "LEFT JOIN {$wpdb->wpe_dates} as wpe_dates on wpe_dates.wpe_event_id = {$wpdb->posts}.ID ");
$join .= $leftJoin;
}
return $join;
}
Expand Down Expand Up @@ -207,7 +208,7 @@ public function eventsQueryResults($posts, $wp_query) : array
private function areDatesFieldsConcatened($wp_query)
{

return !(isset($wp_query->query_vars['wpe_date_query']) || $this->isOrderByEvent($wp_query->query_vars['orderby'])) || is_search();
return !(isset($wp_query->query_vars['wpe_date_query']) || $this->isOrderByEvent($wp_query->query_vars['orderby']));
}

/**
Expand Down

0 comments on commit d43f17d

Please sign in to comment.