Support

Account

Home Forums Backend Issues (wp-admin) Escaping html in message fields

Solving

Escaping html in message fields

  • I’m trying to use ACF options pages and message fields to create back-end-help pages.

    Unfortunately you can’t escape html – doing so changes the message field to a text field and deletes the content.

    For example – my client wants to be able to write CO2 – with a small 2

    I’m trying to tell them to write CO<sub>2</sub> but the message field renders it.

    When I write CO\<sub\>2\<\/sub\>

    The field is changed to a text field

  • Hi @zander

    So the field is changed into a textarea which you can edit??

  • if you use all message fields like this,
    than try this: (unfortunately you need to edit corefile)
    /wp-content/plugins/advanced-custom-fields-pro/fields/message.php

    $m = $field['message']; //search this line
    $m = htmlentities($m); //add this line before wptexturize line
  • Well there’s also a setting for it in the message field.
    “Escape HTML”.
    “Allow HTML markup to display as visible text instead of rendering”.

    That should be fine no? There’s also the load_value filter which you could possibly use instead of modifying core files.
    http://www.advancedcustomfields.com/resources/acfload_value/

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Escaping html in message fields’ is closed to new replies.