'comment_form', 'comment_hook_form_build_preview' => 'comment_form_build_preview', 'comment_hook_form_validate' => 'comment_form_validate', 'comment_hook_form_submit_build_comment' => 'comment_form_submit_build_comment', 'comment_hook_form_submit' => 'comment_form_submit', 'field_hook_format' => 'field_format', 'options_hook_form2data' => 'options_form2data', 'file_module_test_hook_form' => 'file_module_test_form', 'filter_hook_format_load' => 'filter_format_load', 'filter_hook_format_save' => 'filter_format_save', 'filter_hook_format_delete' => 'filter_format_delete', 'filter_hook_formats' => 'filter_formats', 'filter_hook_format_allowcache' => 'filter_format_allowcache', 'filter_hook_form' => 'filter_form', 'profile_hook_form_profile' => 'profile_form_profile', 'search_hook_form' => 'search_form', 'form_test_hook_form_clean_id_page' => 'form_test_form_clean_id_page', 'taxonomy_hook_form' => 'taxonomy_form', 'taxonomy_hook_form_all' => 'taxonomy_form_all', ); foreach ($i as $filename) { if (preg_match('/\.(?:module|inc)$/', $filename, $matches)) { $module = basename($filename, $matches[0]); $from = preg_replace('/^/', 'function ' . $module, $hooks); $to = preg_replace('/^/', 'function ' . $module . '_hook', $hooks); $contents = str_replace($from, $to, file_get_contents($filename)); $contents = strtr($contents, $exceptions); #$contents = preg_replace('/function ' . $module . '((?:[^(](?!hook))+_alter\()', 'function ' . $module .'_hook_\1', $contents); file_put_contents($filename, $contents); } }