Support

Account

Home Forums Backend Issues (wp-admin) layout_title gets escaped by JS after being rendered

Solved

layout_title gets escaped by JS after being rendered

  • I am using the acf/fields/flexible_content/layout_title Filter, which works as i need it. except that when users enter apostrophes they get escaped. I am using htmlentities( ) so they are fine at first but eventually get escaped by JS.

  • after trying a few things it looks like the solution is to return stripslashes($title); any attempts to encode or decode html get cancelled out by the fact that the next time the ajax_layout_title loop runs JS will sanitize it.
    stripping right before returning let’s jQuery do whatever it wants with the string, cleaning up just before it is shown to the user.

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

The topic ‘layout_title gets escaped by JS after being rendered’ is closed to new replies.