Skip to content

Commit 0f0a937

Browse files
authored
add the facetwp file (#85)
1 parent 05ac55f commit 0f0a937

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Integrations/FacetWp.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace BernskioldMedia\WP\Experience\Integrations;
4+
5+
class FacetWp extends Integration {
6+
public static string $plugin_file = 'facetwp/index.php';
7+
8+
public static function hooks(): void {
9+
/**
10+
* set is_main_query to false to stop facetwp to alter tribe_events queries causing events to
11+
* display in the wrong order if used in our BM Block Library
12+
*/
13+
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
14+
if ( 'tribe_events' == $query->get( 'post_type' ) ) {
15+
$is_main_query = false;
16+
}
17+
return $is_main_query;
18+
}, 10, 2 );
19+
}
20+
}

0 commit comments

Comments
 (0)