function views_new_view

3.x views.module views_new_view()
2.x views.module views_new_view()

Create an empty view to work with.

Return value

view A fully formed, empty $view object. This object must be populated before it can be successfully saved.

1 call to views_new_view()
1 string reference to 'views_new_view'
views_schema_6000 in ./views.install
Views 2's initial schema. Called directly by views_update_6000() for updates from Drupal 5.

File

./views.module, line 1363
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_new_view() {
  views_include('view');
  $view = new view();
  $view->vid = 'new';
  $view->add_display('default');

  return $view;
}