How can I change the file field description without altering a module file?

The function I would like to modify is theme_file_upload_help().


I have accomplished similar by using a hook_form_alter() in a custom module and altering the field's #description property.

  • This would only change the field in one specific form, i would like to change it in every existing form. – Sven Mar 19 '14 at 15:58
  • hook_form_alter() affects every single form and is suitable for changing the field everywhere it appears. If you wanted only one form you would use hook_form_FORM_ID_alter(). – beth Mar 19 '14 at 15:59

If it's a theme function you want to override, then the way to do that is to write a function called mytheme_file_upload_help (if your theme is called mytheme).

so in your mytheme/template.php file:

function mytheme_file_upload_help($variables) {
   ... your code here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.