The snap code below has been tested only on D7. In case this code does not work on D6, check out the comments on this post here[post here][1].
function MYMODULE_views_pre_view(&$view, &$display_id, &$args) {
if ($view->name == 'VIEW_NAME' && $display_id == 'DISPLAY_ID') {
// To find out the DISPLAY_NAME, FIELD_NAME and FIELD_VALUE use the devel module function
// below to print them out.
// Replacing 'footer' by 'header' works the same way.
dpm($view->display_handler->options['footer']['DISPLAY_NAME']['FIELD_NAME']);
$view->set_item_option($display_id, 'footer', 'DISPLAY_NAME', 'FIELD_NAME', 'FIELD_VALUE');
// In this case scenario you needed to unset the footer display.
// For the embedded view display you do like this:
$view->set_item_option($display_id, 'footer', 'DISPLAY_NAME', 'view_to_insert', '');
// For the normal text area display you do like this:
$view->set_item_option($display_id, 'footer', 'DISPLAY_NAME', 'content', '');
}
}
Due to comments, to determine what views name and display came to this function, make next (of course, "devel" module should be enabled)
function MYMODULE_views_pre_view(&$view, &$display_id, &$args) {
dsm($view->name);
dsm($display_id);
if ($view->name == 'VIEW_NAME' && $display_id == 'DISPLAY_ID') {
...
}
}
And update views page. [1]: http://drupal.org/node/749452 [2]: http://drupal.org/node/749452#comment-5433982