diff --git a/core/includes/theme.inc b/core/includes/theme.inc index ec97db2..4b55e32 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -96,16 +96,13 @@ function theme_get_registry($complete = TRUE) { /** * Returns an array of default theme features. * - * @see \Drupal\Core\Extension\ThemeHandler::$defaultFeatures + * @see \Drupal\Core\Theme\ThemeSettings::defaults() + * + * @deprecated in Drupal 8.2.x, will be removed before Drupal 9.0.0. + * Use \Drupal\Core\Theme\ThemeSettings::defaults() instead. */ function _system_default_theme_features() { - return array( - 'favicon', - 'logo', - 'node_user_picture', - 'comment_user_picture', - 'comment_user_verification', - ); + return ThemeSettings::defaults(); } /** @@ -333,7 +330,7 @@ function theme_get_setting($setting_name, $theme = NULL) { // If the theme does not support a particular feature, override the global // setting and set the value to NULL. if (!empty($theme_object->info['features'])) { - foreach (_system_default_theme_features() as $feature) { + foreach (ThemeSettings::defaults() as $feature) { if (!in_array($feature, $theme_object->info['features'])) { $cache[$theme]->set('features.' . $feature, NULL); } diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php index 8c573bb..3be02e7 100644 --- a/core/lib/Drupal/Core/Extension/ThemeHandler.php +++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php @@ -4,6 +4,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\State\StateInterface; +use Drupal\Core\Theme\ThemeSettings; /** * Default theme handler using the config system to store installation statuses. @@ -11,21 +12,6 @@ class ThemeHandler implements ThemeHandlerInterface { /** - * Contains the features enabled for themes by default. - * - * @var array - * - * @see _system_default_theme_features() - */ - protected $defaultFeatures = array( - 'favicon', - 'logo', - 'node_user_picture', - 'comment_user_picture', - 'comment_user_verification', - ); - - /** * A list of all currently available themes. * * @var array @@ -266,7 +252,7 @@ public function rebuildThemeData() { 'breadcrumb' => 'Breadcrumb', ), 'description' => '', - 'features' => $this->defaultFeatures, + 'features' => ThemeSettings::defaults(), 'screenshot' => 'screenshot.png', 'php' => DRUPAL_MINIMUM_PHP, 'libraries' => array(), diff --git a/core/lib/Drupal/Core/Theme/ThemeSettings.php b/core/lib/Drupal/Core/Theme/ThemeSettings.php index 9cae321..63dac38 100644 --- a/core/lib/Drupal/Core/Theme/ThemeSettings.php +++ b/core/lib/Drupal/Core/Theme/ThemeSettings.php @@ -49,4 +49,19 @@ public function getCacheTags() { return ['rendered']; } + /** + * Returns the features enabled for themes by default. + * + * @return string[] + */ + public static function defaults() { + return [ + 'favicon', + 'logo', + 'node_user_picture', + 'comment_user_picture', + 'comment_user_verification', + ]; + } + }