Answers for "drupal 9 remove field from view"

PHP
0

drupal 9 remove field from view

// use this hook to remove fields because this fires before the
// query, but after the display is loaded.  therefore, it's a simple
// field unset.  dump $view->getDisplay() to see what's loaded.

function mymod_views_pre_build(ViewExecutable $view) {
	unset($view->field['name']);
}
Posted by: Guest on June-14-2021

Browse Popular Code Answers by Language