BUG: Plugin overwrite cf7 hidden fields
-
The file cf7cf.php hooks the cf7 filter ‘wpcf7_form_hidden_fields’ on line 290, but instead of returning an updated set of hiddend fields, overwrites it completly, breaking other plugins using the same functionality,
add_action('wpcf7_form_hidden_fields', 'wpcf7cf_form_hidden_fields',10,1); function wpcf7cf_form_hidden_fields($hidden_fields) { $current_form = wpcf7_get_current_contact_form(); $current_form_id = $current_form->id(); $options = array( 'form_id' => $current_form_id, 'conditions' => get_post_meta($current_form_id,'wpcf7cf_options', true), 'settings' => get_option(WPCF7CF_OPTIONS) ); return array( '_wpcf7cf_hidden_group_fields' => '', '_wpcf7cf_hidden_groups' => '', '_wpcf7cf_visible_groups' => '', '_wpcf7cf_options' => ''.json_encode($options), ); }it should return instead,
return array_merge($hidden_fields, array( '_wpcf7cf_hidden_group_fields' => '', '_wpcf7cf_hidden_groups' => '', '_wpcf7cf_visible_groups' => '', '_wpcf7cf_options' => ''.json_encode($options), ));
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
The topic ‘BUG: Plugin overwrite cf7 hidden fields’ is closed to new replies.