WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Settings > Formatting fields display HTML special characters wrong

[Resolved] Settings > Formatting fields display HTML special characters wrong

  • Daedalon

    @daedalon

    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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcus

    @netweblogic

    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.

    Daedalon

    @daedalon

    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.

    Plugin Author Marcus

    @netweblogic

    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 🙂

    Daedalon

    @daedalon

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Settings > Formatting fields display HTML special characters wrong’ is closed to new replies.
Skip to toolbar