refactor(2meet-data-optimizer-hivepress-addon): leave HivePress queries to the post router
- Do not bind optimize_query / optimize_search on hivepress/v1/models/{listing,vendor}/{query,search} while core's TMDO_Post_Query_Router is active: core now routes HivePress searches (filters and _sort) to the entity flat tables, and two routers would claim the same clauses
- Version 0.2.0 (released with core 1.1.0); CHANGELOG
- Verify: composer test (144, +2 binding tests); integration 49; dev36 fe.sh 9 URLs ids == native (except known flat drift)
- PR: PR-063
This commit is contained in:
@@ -138,8 +138,14 @@ if ( ! class_exists( 'TMDO_HivePress_Core_Adapter' ) ) {
|
||||
|
||||
/**
|
||||
* Bind HivePress search query hooks at priority 20 (after HP setup).
|
||||
*
|
||||
* Not while core's post router serves HivePress searches from the
|
||||
* entity flat tables: two routers would claim the same clauses.
|
||||
*/
|
||||
public function on_register_query_hooks(): void {
|
||||
if ( class_exists( 'TMDO_Post_Query_Router' ) && TMDO_Post_Query_Router::is_router_active() ) {
|
||||
return;
|
||||
}
|
||||
foreach ( self::HOT_MODELS as $model => $post_type ) {
|
||||
unset( $post_type ); // Bound below by string-interpolated $model only.
|
||||
add_action(
|
||||
|
||||
Reference in New Issue
Block a user