• Resolved jackbluehouse2019

    (@jackbluehouse2019)


    I am developing a plugin in which there is a form. I would like to replace the textarea field with a text editor. I’ve read that there is the wp_editor function which should do this but I can’t find the code to match.
    This my code where I’d like to replace textarea by wp_editor :

    echo"
    <form action='test.php' method='post'>
    
    <textarea  name=jb_test
              rows=3 cols=40>
    </textarea 
    
    <input type='submit' value='Valider' />
    </form>";
    

    Thanks for helping a french beginner
    Jacques

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter jackbluehouse2019

    (@jackbluehouse2019)

    Ok I found the solution. Here is my code :

    echo '<form action="test.php" method="post">';
    	
    	$default_content='<p>Your text</p>';
    	$editor_id = 'blabla';
    	$arg =array(
    		'textarea_name' => 'content',
    		'media_buttons' => false,
    		'textarea_rows' => 8,
    		'quicktags' => true,
    		'wpautop' => false,
    		'teeny' => true); 
    		
    	wp_editor( $default_content, $editor_id,$arg );
    echo'<br>';
    	submit_button('Enregistrer', 'primary'); 
    echo '</form>';
    
Viewing 1 replies (of 1 total)
  • The topic ‘Replace textarea by text editor’ is closed to new replies.