Programmatically adding field in header VIEWS

Public

Get raw version
php
  1. function hook_views_pre_view($view, &$display_id, &$args) {
  2. if ($view->name == 'my_view' && $display_id == 'my_display' ) {
  3. $header = t('My custom text');
  4. $view->add_item('my_display', 'header', 'views', 'area', array('content' => $header, 'format' => 'full_html'));
  5. }
  6. }