diff --git a/better_formats.admin_settings.inc b/better_formats.admin_settings.inc index 39e2c0f..cb13b20 100644 --- a/better_formats.admin_settings.inc +++ b/better_formats.admin_settings.inc @@ -23,6 +23,12 @@ function better_formats_admin_settings_form($form, &$form_state) { '#description' => t('Use the core field module default value to set the default format. This will force the default format even when the default field value is empty. To set a default format you must re-edit a text field after saving it with the "Filtered text" option turned on.'), '#default_value' => variable_get('better_formats_per_field_core', 0), ); + $form['control']['better_formats_long_text_processing'] = array( + '#type' => 'checkbox', + '#title' => t('Make new text areas fields default to use the "Filtered text" option rather than "Plain text".'), + '#default_value' => variable_get('better_formats_long_text_processing', 0), + ); + /* $form['control']['better_formats_per_node_type'] = array( '#type' => 'checkbox', @@ -32,5 +38,7 @@ function better_formats_admin_settings_form($form, &$form_state) { ); */ - return system_settings_form($form); + $form = system_settings_form($form); + $form['#submit'][] = 'field_cache_clear'; + return $form; } diff --git a/better_formats.module b/better_formats.module index 8cfd34f..bc3ed1e 100644 --- a/better_formats.module +++ b/better_formats.module @@ -410,3 +410,12 @@ function theme_better_formats_field_default_order(&$variables) { return $output; } + +/** + * Implements hook_field_info_alter(). + */ +function better_formats_field_info_alter(&$info) { + $default = variable_get('better_formats_long_text_processing', 0); + $info['text_long']['instance_settings']['text_processing'] = $default; + $info['text_with_summary']['instance_settings']['text_processing'] = $default; +}