• Resolved pixselig

    (@pixselig)


    Hi Johann,

    first: thanks for your really helpfully Addon/Plugin.
    I use it on several sites and it works perfectly well.

    But now, i have found a problem:
    In some tables i use linebreaks (simple enter-key) and in the frontend is use “nl2br” to convert them to html br-tags. This is working fine. But if i will go back to an older revision of the post, i lost all the linebreaks.

    I was googleing, but didnt fount any solution.

    Any ideas, this would be very helpfull!

    Thanks!
    pixselig

    https://wordpress.org/plugins/advanced-custom-fields-table-field/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Johann Heyne

    (@jonua)

    Thanks for reporting that. I found out, that in general restoring a revision seams to remove all backslashes “\” from ACF fields. This destroys escaped characters like a line break. This can also destroy the syntax of a JSON string in a ACF field.

    This is caused by the ACF wp_restore_post_revision() function while updating post meta. This function uses update_post_meta(), a WordPress function, which passes the value through the stripslashes() function. This could fixed by ACF using wp_slash() on the value before using update_post_meta(). I will ask the ACF support to fix that.

    Thread Starter pixselig

    (@pixselig)

    Wow, thanks a lot for your engagement Johann!
    Best regards from austria 😉

    Plugin Author Johann Heyne

    (@jonua)

    Elliot replied me. He will test this issue and may fix it.

    Plugin Author Johann Heyne

    (@jonua)

    The status is, that this is not an easy to solve issue. There are several solutions to solve the problem but with pros and cons. Elliot and I are still discussing about.

    Plugin Author Johann Heyne

    (@jonua)

    The issue will be fixed in the next ACF release version 5.4.0

    Thanks again for reporting,
    Johann

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress revisions remove line breaks from table fields’ is closed to new replies.