I have the following line of code in a user-profile-form.tpl.php which Drupal uses to render an input field in the user's edit profile page.
print render($form['field_machine_name']);
// this field can be found in the database table field_data_field_machine_name
The issue is that I want to run the value field_machine_name through a function like $form['field_machine_name'] = make_seo_url($form['field_machine_name'])
before I run the render()
function. But this totally breaks the form because $form['field_machine_name']
is some very large array and render()
output html input tag instead of the actual field_machine_name itself.
How does one actually go about massaging values in the $form
variable before outputting it as an html field in render()
?
Additionally, i want to make sure anytime field_machine_name is printed anywhere on the drupal site, i want it to run through the make_seo_url()
function. Is there a global place i can do this?