Support » Plugin: Gravity Forms WYSIWYG » Fix for conflicts issues

  • Hi,

    Gravity-forms-wysiwyg is conflicting with Gravity Forms advanced files uploader. (and probably others add-on for gravity forms).

    To fix it, please replace the “return false;” by “return input;” at the end of the function wysiwyg_field_input in the file gf_wysiwyg_class.php.
    The function must be like that :

    function wysiwyg_field_input($input, $field, $value, $lead_id, $form_id) {
    
        if ($this->is_wysiwyg($field)) { 
    
            $input_id = 'input_' . $form_id . '_' . $field["id"];
    
            if (is_admin()) {
    
                $tabindex = GFCommon::get_tabindex();
    
                return sprintf("<div class='ginput_container'><textarea readonly name='input_%s' id='input_%s' class='textarea gform_wysiwyg' {$tabindex} rows='10' cols='50'>WYSIWYG editor</textarea></div>", $field["id"], 'wysiwyg-' . $field['id']);
    
            } else {
    
                $media_buttons = strpos($field["cssClass"], 'media_buttons') !== false;
    
                $args = array(
                    'textarea_name' => 'input_' . $field["id"],
                    'wpautop'       => true,
                    'media_buttons' => $media_buttons,
                    'editor_class'  => 'frontend',
                    'textarea_rows' => 5,
                    'tabindex'      => 0 //$tabindex
                );
    
                ob_start();
                wp_editor($value, $input_id, $args);
                $html = ob_get_contents();
                ob_end_clean();
    
                return "<div class='ginput_container'>" . $html . "</div>";
    
            }
    
        }
        return $input;
    }

    https://wordpress.org/plugins/gravity-forms-wysiwyg/

  • The topic ‘Fix for conflicts issues’ is closed to new replies.