apply_filters('asp_result_groups', array $groups, int $id, array $args);
add_filter( 'asp_result_groups', 'asp_result_groups_modify', 10, 1 );
function asp_result_groups_modify( $groups) {
foreach ($groups as $slug=>&$group) {
/**
* $slug (string) = 'group_slug',
* $group (array) [
* 'title' => 'Group header title',
* 'items' => array(...) // The actual results
* ]
**/
if ( $group['title'] == 'Group title' ) {
// Change the group title
$group['title'] == 'Modified group title';
// Unset items from group where post ID is 123
foreach ( $group['items'] as $k=>&$r ) {
if ( $r->id == 123 ) {
unset($group['items'][$k]);
}
}
}
}
return $groups ;
}