Last active
February 17, 2021 03:36
-
-
Save frankyonnetti/5944795 to your computer and use it in GitHub Desktop.
Drupal 6 - remove homepage field #drupal #d6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * First register the override in your template.php file (my example uses a zen subtheme) | |
| * http://drupal.org/node/147502#comment-1654954 | |
| */ | |
| <?php | |
| /** | |
| * Implementation of zen HOOK_theme(). | |
| */ | |
| function YOUR-THEME-NAME_theme(&$existing, $type, $theme, $path) { | |
| $hooks = zen_theme($existing, $type, $theme, $path); | |
| $hooks['comment_form'] = array('arguments' => array('form' => NULL)); | |
| return $hooks; | |
| } | |
| ?> | |
| /** | |
| * Then, create a function specific for the comment form in your theme (also in template.php), with code to suppress the homepage field: | |
| */ | |
| <?php | |
| function YOUR-THEME-NAME_comment_form($form) { | |
| $output = ''; | |
| unset ($form['homepage']); | |
| $output .= drupal_render($form); | |
| return $output; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment