function views_disable_view

Same name in other branches
  1. 9 core/modules/views/views.module \views_disable_view()
  2. 8.9.x core/modules/views/views.module \views_disable_view()
  3. 11.x core/modules/views/views.module \views_disable_view()

Disables and saves a view.

Parameters

\Drupal\views\Entity\View $view: The View object to disable.

1 call to views_disable_view()
ModuleTest::testStatusFunctions in core/modules/views/tests/src/Kernel/ModuleTest.php
Tests view enable and disable procedural wrapper functions.

File

core/modules/views/views.module, line 621

Code

function views_disable_view(View $view) {
    $view->disable()
        ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.