WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
Problem maintaining line breaks (8 posts)

  1. Bill Dennen
    Member
    Posted 3 years ago #

    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 )

    Are there other tricks to maintaining line breaks properly?

    (using WP 3.0.3 and Front-end Editor Version 1.9.2.1)

    Thanks!

  2. Bill Dennen
    Member
    Posted 3 years ago #

    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.

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    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 )

    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.

  4. Bill Dennen
    Member
    Posted 3 years ago #

    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.

  5. Bill Dennen
    Member
    Posted 3 years ago #

    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.

  6. Bill Dennen
    Member
    Posted 3 years ago #

    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.
  7. Bill Dennen
    Member
    Posted 3 years ago #

    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.

  8. wert790
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic