system.api.php

Same filename and directory in other branches
  1. 7.x modules/system/system.api.php
  2. 9 core/modules/system/system.api.php
  3. 8.9.x core/modules/system/system.api.php
  4. 10 core/modules/system/system.api.php

Hooks provided by the System module.

File

core/modules/system/system.api.php

View source
<?php


/**
 * @file
 * Hooks provided by the System module.
 */
use Drupal\Core\Url;

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Alters theme operation links.
 *
 * @param $theme_groups
 *   An associative array containing groups of themes.
 *
 * @see system_themes_page()
 */
function hook_system_themes_page_alter(&$theme_groups) {
    foreach ($theme_groups as $state => &$group) {
        foreach ($theme_groups[$state] as &$theme) {
            // Add a foo link to each list of theme operations.
            $theme->operations[] = [
                'title' => t('Foo'),
                'url' => Url::fromRoute('system.themes_page'),
                'query' => [
                    'theme' => $theme->getName(),
                ],
            ];
        }
    }
}

/**
 * @} End of "addtogroup hooks".
 */

Functions

Title Deprecated Summary
hook_system_themes_page_alter Alters theme operation links.

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