Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Zack Katz

    (@katzwebdesign)

    // Like this:
    add_filter('wpcf7_hidden_field_value', 'my_function_to_change_hidden_field_value');
    
    // or like this, if your field has an ID of "example_id"
    add_filter('wpcf7_hidden_field_value_example_id', 'my_function_to_change_hidden_field_value');
    
    function my_function_to_change_hidden_field_value($value) {
    	return 'a different value';
    }

    After half an hour of searching the problem because it did not work:
    ID means literally the ID and not the name of the field

    [hidden Fieldname id:FieldID “—“]
    add_filter(‘wpcf7_hidden_field_value_FieldID‘, …)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to apply filter’ is closed to new replies.