Additional Fields allow HTML

Home Forums Calendar Products Events Calendar PRO Additional Fields allow HTML

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1350045
    Susan
    Participant

    I have begun using the Additional Fields capability to add info to the Meta Box. However, I would like to be able to add html markup to the contents of the field, which is stripping out all formatting and replacing special characters. Is there a code snippet I can add to our functions file which would allow tags in those fields, the same way there’s code to allow tags in post excerpts?

    #1351035
    Jennifer
    Keymaster

    Hi Susan,

    Thanks for reaching out! You are not the first person to ask about this, and yes we do have some code that you can add to get this to work. Let me know how that goes for you and if you have any questions!

    Thanks,

    Jennifer

    #1351403
    Mathew
    Participant

    Susan,

    Please note that the use of esc_html in output is done for a reason.

    I see that in one of your previous posts, you conducted a PCI audit. Removing the escaping may or may not cause warnings in future audits and vulnerability scans.

    There’s plenty of great reads on the Internet on the topic of escaping HTML and best practices.

    I am not saying don’t do it, but understand why it’s there to begin with.

    #1352969
    Jennifer
    Keymaster

    Hi Mathew,

    Thanks for pointing this out and sharing that link!

    Susan, I’d also like to point out that you can add this as a feature request over in our Feature Ideas Forum, which is what we use to gauge user interest in new features and help guide future development efforts. I know there have been other users in the past who have asked about this, so it would definitely be worthwhile to submit it as an official request.

    If you have any questions, please let me know!

    Thanks,

    Jennifer

    #1353692
    Susan
    Participant

    The forum post you reference above is to allow html markup in the description text for fields in the admin view. I want to be able to use markup to style the contents of an additional field on the front end. The specific case that triggered my support request was trying to display a set of links in an additional field as a styled list. The links stayed active, but all the list and styling markup was stripped out. For example, I can use markup by default in custom text fields added to posts using Advanced Custom Fields.
    I will post this in the Featured Ideas Forum, but if I can implement it now that would be preferable.
    Thanks, Susan

    #1355991
    Jennifer
    Keymaster

    Hi Susan,

    Thanks for clarifying and for posting this as a feature request! I did some investigating here, as some HTML can currently be included (a, b, i, strong, and em tags), but unfortunately ‘ul’ and ‘li’ are not currently on that list. You can see this by taking a look at line 213 in /wp-content/plugins/events-calendar-pro/src/Tribe/Custom_Meta.php. You technically could add ul and li to this list, but please note that modifying core files is not recommended as your changes will be overwritten whenever you update the plugin.

    I’m sorry I don’t have a better answer for you, but I hope this helps! Please let me know if you have any other questions.

    Thanks,

    Jennifer

    #1366549
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Additional Fields allow HTML’ is closed to new replies.