theme-settings.php

Same filename in this branch
  1. 7.x themes/garland/theme-settings.php
Same filename in other branches
  1. 9 core/themes/olivero/theme-settings.php
  2. 9 core/modules/system/tests/themes/test_theme_settings/theme-settings.php
  3. 8.9.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php
  4. 10 core/themes/olivero/theme-settings.php
  5. 10 core/modules/system/tests/themes/test_theme_settings/theme-settings.php
  6. 11.x core/themes/olivero/theme-settings.php
  7. 11.x core/modules/system/tests/themes/test_theme_settings/theme-settings.php

Theme setting callbacks for the test_theme theme.

File

modules/simpletest/tests/themes/test_theme/theme-settings.php

View source
<?php


/**
 * @file
 * Theme setting callbacks for the test_theme theme.
 */

/**
 * Implements hook_form_FORM_ID_alter().
 */
function test_theme_form_system_theme_settings_alter(&$form, &$form_state) {
    $form['test_theme_checkbox'] = array(
        '#type' => 'checkbox',
        '#title' => 'Test theme checkbox',
        '#default_value' => theme_get_setting('test_theme_checkbox'),
    );
    // Force the form to be cached so we can test that this file is properly
    // loaded and the custom submit handler is properly called even on a cached
    // form build.
    $form_state['cache'] = TRUE;
    $form['#submit'][] = 'test_theme_form_system_theme_settings_submit';
}

/**
 * Form submission handler for the test theme settings form.
 *
 * @see test_theme_form_system_theme_settings_alter()
 */
function test_theme_form_system_theme_settings_submit($form, &$form_state) {
    drupal_set_message('The test theme setting was saved.');
}

Functions

Title Deprecated Summary
test_theme_form_system_theme_settings_alter Implements hook_form_FORM_ID_alter().
test_theme_form_system_theme_settings_submit Form submission handler for the test theme settings form.

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