devinsays/options-framework-plugin — Issue #85: Using wp_editor with textareas
Author: samueljon
Created: 2012-01-05 16:40:08+00:00
State: open

It would be nice if it were possible to use [wp_editor](http://codex.wordpress.org/Function_Reference/wp_editor) that has been available since WordPress release 3.3.

### Basic structure of a textarea
```html

Textarea body

Textarea description

```

### Using wp_editor for textarea
This is a code from options-interface.php starting at line 88 where I've commented out the textarea section and replaced with a call to the wp_editor.

```php
// Textarea
case 'textarea':
$cols = '8';
$ta_value = '';

if(isset($value['options'])){
$ta_options = $value['options'];
if(isset($ta_options['cols'])){
$cols = $ta_options['cols'];
} else { $cols = '8'; }
}

$val = stripslashes( $val );

//$output .= '' . esc_textarea( $val ) . '';

$settings = array(
'wpautop' => true,
'media_buttons' => true,
'textarea_name'	=> esc_attr( $option_name . '[' . $value['id'] . ']' ),
'editor_class'	=> 'of-input',
'editor_rows'	=> '8',
'tinymce' => array(
'theme_advanced_buttons1' => 'bold,italic,underline,blockquote,|,undo,redo,|,fullscreen',
'theme_advanced_buttons2' => '',
'theme_advanced_buttons3' => '',
'theme_advanced_buttons4' => ''
),
'quicktags' => array(
'buttons' => 'b,i,ul,ol,li,link,close'
)
);
$output .= wp_editor( $val,$value['id'], $settings );
break;
```

### The Problem
The wp_editor gets initiated and displays the data correctly in tinymce editor but since the wp_editor generates additional code around the textarea the CSS posititon is no longer correct. Since the structure is not correct the text-areas are now misplaced and are displayed before the options tabs. So possible solution would be to tinker a little bit more with the CSS so that the text-areas are place at the right position.

I'm not that experienced with hacking CSS it would be great to get hints and insights from other developers and users of the options framework plugin if this feature is something that would be included in the project.