Convert textarea with wp_editor

I have a custom tabbed menu which has some input fields that works properly. I followed this tutorial: http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-8-validation-sanitisation-and-input-ii/

But, I need to replace the textarea input for the rich text element. I tried to use the function wp_editor() but I do not know how to pass the id from the textarea.

Read More

How can I add or manage de editor inside? I saw some tutorials but still with problems.

Thanks in advance

This is de Code:

This is the code.

Here. I create de field:

add_settings_field( 
'Textarea Element', 
__( 'Textarea a TinyMCE', 'mymenu' ),   
'textarea_element_callback',    
'theme_input_examples', 
'input _section'    
);

And here I made and echo to show it on my admin page:

function textarea_element_callback() {
$options = get_option( 'theme_input_examples' );
echo '<textarea id="textarea_example" name=" theme_input_examples[textarea_example]" rows="5" cols="40">' . $options['textarea_example'] . '</textarea>';
} 

This is the menu where I display the textarea:

add_submenu_page(
'theme_menu',
__( 'Opfolgning pa kontrakt', 'mymenu' ),
__( 'Opfolgning pa kontrakt', ' mymenu ' ),
'administrator',
'theme_input_examples',
create_function( null, 'theme_display( "input_examples_4" );' )
);

Related posts

1 comment

  1. This is was I use to convert textarea with wp_editor()

    wp_editor($value, "editor-name", array(
    
        'tinymce' => array(
    
            'theme_advanced_buttons1' => 'bold,italic,underline',
    
            'theme_advanced_buttons2' => '',
    
            'theme_advanced_buttons3' => ''
    
        )
    
    ));
    

Comments are closed.