WordPress.org

Forums

Events Manager
[resolved] Settings > Formatting fields display HTML special characters wrong (5 posts)

  1. Daedalon
    Member
    Posted 2 years ago #

    When editing the formatting of for example the Single Location page and typing "& nbsp;" (without the space) for a non-breaking space, it gets saved in the database correctly, but when viewing the page again, it is shown in the editor as a regular space. Thus if you edit a different part of the setting field and save it, it is now saved into db as a regular space.

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    not sure there's much we can do about that... if we try to convert the & then it'll convert everything including the html tags.

  3. Daedalon
    Member
    Posted 2 years ago #

    Depending on how the conversion is currently done, one way is to double-encode every "& nbsp;" (without the space) before the display. Perhaps extend it to all "& something;" (without the space) special chars.

    Something like $text = preg_replace( '_&([A-Za-z0-9#]+;)_', '& amp;$1', $text ); (without the space after "&") should do the trick.

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    could look into that in the future but there's other implications with that. For now I suggest you hook into the wp filter option_dbem.... for the options you need this on and apply this to the options you want to add this to.

    if we add this for "& amp;" then the next request will be for some other entity :)

  5. Daedalon
    Member
    Posted 2 years ago #

    if we add this for "& amp;" then the next request will be for some other entity :)

    For this I suggested doing it for all entities at once with the preg_replace above. Requires testing, though.

    Will look into that filter, thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.