Title: Posting TinyMCE data to database
Last modified: August 19, 2016

---

# Posting TinyMCE data to database

 *  [viviosoft](https://wordpress.org/support/users/viviosoft/)
 * (@viviosoft)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/posting-tinymce-data-to-database/)
 * Hello all,
 * I’m not sure if this is the right place to ask such a question but…
 * I’m creating a plugin and I’m utilizing the TinyMCE editor. I have it working
   but when I post the data to the database it doesn’t _**carry over the \n or line
   breaks?**_
 * This is how I incorporate the editor in my plugin. I use the $name as a means
   to pass the data to the database… not sure if that’s the correct way to send 
   the data to the database? Any help would be great.
 *     ```
       <?php the_editor($pageInfo->html, $name = 'editor'); ?>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [viviosoft](https://wordpress.org/support/users/viviosoft/)
 * (@viviosoft)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/posting-tinymce-data-to-database/#post-1454771)
 * The solution is to format the posted text using the wpautop() function. This 
   will “clean” the code and add the necessary <p> tags where there are line breaks.
 * You can ready more about this here:
    [http://codex.wordpress.org/How_WordPress_Processes_Post_Content](http://codex.wordpress.org/How_WordPress_Processes_Post_Content)
 * Example:
 *     ```
       $content = wpautop( $_POST['editorContent'], $br = 1 );
       ```
   
 *  [Meini](https://wordpress.org/support/users/meini/)
 * (@meini)
 * [16 years ago](https://wordpress.org/support/topic/posting-tinymce-data-to-database/#post-1454995)
 * Thanks [@viviosoft](https://wordpress.org/support/users/viviosoft/) you made 
   my day!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Posting TinyMCE data to database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [tinymce](https://wordpress.org/support/topic-tag/tinymce/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Meini](https://wordpress.org/support/users/meini/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/posting-tinymce-data-to-database/#post-1454995)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
