refactor(2meet-data-optimizer-hivepress-addon): leave HivePress queries to the post router
Tests / PHP Lint (pull_request) Successful in 1m5s
Tests / Unit Tests (pull_request) Successful in 1m9s
Tests / Integration Tests (pull_request) Failing after 1m46s

- 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:
2026-09-26 20:19:27 +08:00
parent 61762c49d0
commit a01314cbb1
4 changed files with 51 additions and 2 deletions
@@ -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(