I am trying to not show a certain view result using hook_views_pre_render but I didn't find the correct way to not display the result.
I did manage to have access to the view and change each result title to a test title, code:
function MODULENAME_views_pre_render(\Drupal\views\ViewExecutable $view) {
if($view->id() == 'tasks') {
foreach($view->result as $task) {
$task->_entity->set('title', 'test - ' . time());
}
}
}
I want to use something like $task->show = false;, is there any way?
Thank you!