Home › Forums › Calendar Products › Events Calendar PRO › Additional Fields allow HTML
- This topic has 7 replies, 3 voices, and was last updated 6 years, 7 months ago by Susan.
-
AuthorPosts
-
September 15, 2017 at 4:53 pm #1350045SusanParticipant
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?
September 19, 2017 at 4:54 am #1351035JenniferKeymasterHi 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
September 19, 2017 at 12:02 pm #1351403MathewParticipantSusan,
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.
September 21, 2017 at 12:28 pm #1352969JenniferKeymasterHi 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
September 22, 2017 at 2:58 pm #1353692SusanParticipantThe 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, SusanSeptember 28, 2017 at 3:44 am #1355991JenniferKeymasterHi 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
October 20, 2017 at 9:36 am #1366549Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Additional Fields allow HTML’ is closed to new replies.