Function not firing
-
Hi there – I can’t seem to get this function to fire and pre populate the address field on my contact form with anything at all… any ideas?
add_filter( 'cf7_2_post_filter_cf7_field_value', 'field_default_value',10,5); function field_default_value($value, $cf7_id, $field, $cf7form_key, $form_terms){ if('your-address' == $field){ global $current_user; //get your user's address $value='test'; } return $value; }
It’s loaded on the page with
[cf7-form cf7key="untitled-2"]
And the field on the form is:
<div class="input-area"> Address: *[text* your-address class:input-box] </div>
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Function not firing’ is closed to new replies.