VAT
Your cart

Your cart is empty.

Query advisor hooks

This page lists the 3 hooks of this group. Each entry shows its type, the version it arrived in, where it runs, its arguments and a starting point.

adba_query_rules

FilterSince 2.29.0 Runs in src/Modules/QueryAdvisor/RuleSet.php.

Filters the rules of the query advisor by id, to remove or replace one.

ArgumentTypeDescription
$rulesarray<string, RuleInterface>Rules by id.
add_filter( 'adba_query_rules', function ( $rules ) {
	return $rules;
} );

adba_query_scan_screens

FilterSince 2.29.0 Runs in src/Modules/QueryAdvisor/Scanner.php.

Filters the screens an active query scan loads. Each screen has a label and a path relative to wp-admin; add lock (type post or order, id) when the path opens an edit screen, so the scan puts the edit lock back afterwards. Never add a path that changes something when it is opened.

ArgumentTypeDescription
$screensarray<int, array<string, mixed>>Screens in scan order.
add_filter( 'adba_query_scan_screens', function ( $screens ) {
	return $screens;
} );

adba_register_query_rules

ActionSince 2.29.0 Runs in src/Modules/QueryAdvisor/RuleSet.php.

Fires when the query advisor collects its rules. Call $set->add( $rule ) with an object that implements AddoBack\Modules\QueryAdvisor\Rules\RuleInterface (extend AbstractRule for the defaults).

ArgumentTypeDescription
$setRuleSetThe rules.
add_action( 'adba_register_query_rules', function ( $set ) {
	// ...
} );

Ready to connect your AI to real tools?

Start free trial