欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal7 新drupal settings.php,theme-settings.php 有大用

/**

* Implements hook_form_system_theme_settings_alter().

*

* @param $form

* Nested array of form elements that comprise the form.

* @param $form_state

* A keyed array containing the current state of the form.

*/

function hktv2_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) {

// Work-around for a core bug affecting admin themes. See issue #943212.

if (isset($form_id)) {

return;

}

// Create the form using Forms API: http://api.drupal.org/api/7

/* -- Delete this line if you want to use this setting

$form['hktv2_example'] = array(

'#type' => 'checkbox',

'#title' => t('hktv2 sample setting'),

'#default_value' => theme_get_setting('hktv2_example'),

'#description' => t("This option doesn't do anything; it's just an example."),

);

// */

// Remove some of the base theme's settings.

/* -- Delete this line if you want to turn off this setting.

unset($form['themedev']['zen_wireframes']); // We don't need to toggle wireframes on this site.

// */

// We are editing the $form in place, so we don't need to return anything.

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

来自  https://blog.csdn.net/weixin_30463341/article/details/98724595


普通分类: