Support

Account

Home Forums Backend Issues (wp-admin) Escaped HTML in labels since ACF 6.4.3

Solving

Escaped HTML in labels since ACF 6.4.3

  • Hi,
    i do not know the reasons for escaping HTML from field labels, but in my case it causes unwanted issues. Sometimes i add the HTML code for fontawesome icons to my label text to increase the usability for my editors. This HTML code isn’t parsing anymore.

    For the moment i “fixed” this for me just by replacing the entity code of the “<” and the “>” back. But it would be nice, if you could finetune this strict bugfixing. If not, i am pleased with my own solution to replace this back.

  • I have the same problem. Good reason to use HTML in label, and the solution of replacing the entity code did not work out for me. There should be an option at the field level.

    Also, the “allow html” in the message settings seems not to work anymore.

  • This worked for me for the field label. Some other parts like flexible field titles ar not yet working and escaped. Try to find a solution for that too. But the labels can contain html code again.

    add_filter('acf/get_field_label', function($label, $field, $context) {
    	return html_entity_decode($label);
    }, 10, 3);
  • Thanks, that worked also for me.

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

You must be logged in to reply to this topic.