Title: [Plugin: Front-end Editor] Problem maintaining line breaks
Last modified: August 19, 2016

---

# [Plugin: Front-end Editor] Problem maintaining line breaks

 *  [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/)
 * Hi,
 * I am using Front-End Editor to edit some custom fields, which are part of a custom
   post type. In general, things are working fine.
 * However, I often lose line breaks ( `<br>` and `<p>`) when saving the data.
 * This is in my template:
 * `echo wpautop( editable_post_meta(get_the_ID(), 'degrees', 'rich') );`
 * (based on: [http://wordpress.org/support/topic/plugin-front-end-editor-custom-fields-on-static-pages](http://wordpress.org/support/topic/plugin-front-end-editor-custom-fields-on-static-pages))
 * Are there other tricks to maintaining line breaks properly?
 * (using WP 3.0.3 and Front-end Editor Version 1.9.2.1)
 * Thanks!

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

 *  Thread Starter [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1816797)
 * Addendum: Nicedit seems to be have differently in custom fields vs the_content
   field.
 * When it’s in the_content, hitting return will put a blank line in between text.
 * When it’s it a custom field, hitting return simply puts a carriage return in.
 * Why would these behave differently? Does this provide a clue to what might be
   going on?
 * thanks.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1816867)
 * >  This is in my template:
   > `echo wpautop( editable_post_meta(get_the_ID(), 'degrees', 'rich') );`
   > (based on: [http://wordpress.org/support/topic/plugin-front-end-editor-custom-fields-on-static-pages](http://wordpress.org/support/topic/plugin-front-end-editor-custom-fields-on-static-pages))
 * Yeah, that’s wrong; sorry. Try this (notice the _false_ at the end):
 * `echo wpautop( editable_post_meta(get_the_ID(), 'degrees', 'rich', false) );`
 * > When it’s it a custom field, hitting return simply puts a carriage return in.
 * In my testing, that only happens the first time, when the editor is empty. It’s
   a bug in NicEdit.
 *  Thread Starter [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1816905)
 * Thank you, scribu.
 * This is better. I’ve also noticed that you temporarily lose line breaks after
   you edit a custom field in NicEdit and hit Save. If you reload your post, things
   are back to normal. Is this also a bug in NicEdit?
 * I really like your plugin, and we’re excited to deploy it to our users to edit
   pages.
 *  Thread Starter [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1817120)
 * We’re also seeing a loss of line breaks when hitting “Save”. If I reload the 
   post, the line breaks are there, as expected.
 * 1) load post
    2) double-click on a custom field to edit it in NicEdit 3) hit 
   save 4) field loses line breaks — 5) reload post 6) line breaks are there ok.
 *  Thread Starter [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1817185)
 * scribu, is this expected behavior for editing custom fields with the rich text
   editor? That is, loss of line breaks, temporarily until reloading the post.
 *     ```
       We're also seeing a loss of line breaks when hitting "Save". If I reload the post, the line breaks are there, as expected.
   
       1) load post
       2) double-click on a custom field to edit it in NicEdit
       3) hit save
       4) field loses line breaks
       --
       5) reload post
       6) line breaks are there ok.
       ```
   
 *  Thread Starter [Bill Dennen](https://wordpress.org/support/users/xyzzy/)
 * (@xyzzy)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1817186)
 * FYI, I am still seeing this same behavior in the latest version of FEE, which
   uses CLEditor. I see the behavior when editing custom fields.
 *  [wert790](https://wordpress.org/support/users/wert790/)
 * (@wert790)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1817196)
 * Firstly, thanks to scribu for a truly awesome plugin that takes wordpress user-
   friendlyness to a new level :)!
 * I experience the same problem as wjdennen, i also use custom fields and theis
   code to get the meta:
    echo wpautop(editable_post_meta(get_the_ID(), ‘kol1’, ‘
   rich’, $echo = false));
 * I can edit it, but it strips out the paragraphs on the AJAX(?) loading, but works
   fine when i update. This may cause confusion for my customers that will update
   the site. Is there any work-around available?
 * Again, thanks for a awesome plugin!

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

The topic ‘[Plugin: Front-end Editor] Problem maintaining line breaks’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/front-end-editor.svg)
 * [Front-end Editor](https://wordpress.org/plugins/front-end-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/front-end-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/front-end-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/front-end-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/front-end-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/front-end-editor/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [wert790](https://wordpress.org/support/users/wert790/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-front-end-editor-problem-maintaining-line-breaks/#post-1817196)
 * Status: not resolved