You are here

public function ThemeHandler::uninstall in Drupal 8

Uninstalls a given list of themes.

Uninstalling a theme removes all related configuration (like blocks) and invokes the 'themes_uninstalled' hook.

Parameters

array $theme_list: The themes to uninstall.

Throws

\Drupal\Core\Extension\Exception\UninstalledExtensionException Thrown when you try to uninstall a theme that wasn't installed.

Overrides ThemeHandlerInterface::uninstall

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the theme_installer service instead.

See also

https://www.drupal.org/node/3017233

hook_themes_uninstalled()

\Drupal\Core\Extension\ThemeInstallerInterface::uninstall()

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 93

Class

ThemeHandler
Default theme handler using the config system to store installation statuses.

Namespace

Drupal\Core\Extension

Code

public function uninstall(array $theme_list) {

  // We keep the old uninstall() method as BC layer but redirect directly to
  // the theme installer.
  @trigger_error('\\Drupal\\Core\\Extension\\ThemeHandlerInterface::uninstall() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \\Drupal\\Core\\Extension\\ThemeInstallerInterface::uninstall() instead. See https://www.drupal.org/node/3017233', E_USER_DEPRECATED);
  \Drupal::service('theme_installer')
    ->uninstall($theme_list);
}