Home › Forums › Calendar Products › Events Calendar PRO › URL fields not rendering correctly
- This topic has 4 replies, 2 voices, and was last updated 10 years, 7 months ago by
George.
-
AuthorPosts
-
October 1, 2015 at 8:20 am #1010485
Christopher
ParticipantRunning 3.12.2
I am using an additional field, defined in Settings > Additional Fields. The field type is URL. The details from that field are not showing correctly for end users. It does show correct in admin.
For example, if the content of that field in admin is “http://bit.ly/1LoafHZ” (without the quotes), it renders as “” (without the quotes). The end user is seeing the HTML.
You can see this at http://www.alomachurch.org/calendar/parents-night-out-16/
Any ideas?
October 1, 2015 at 8:22 am #1010486Christopher
ParticipantThe forum took details out of my post above….basically, it is rendering with the correct content and HTML structure, but the end users is seeing the “a” tags. The HTML encoded output is being displayed to the end user.
October 1, 2015 at 1:08 pm #1010619George
ParticipantHey @cmonaghan76,
I’m sorry about this issue, it is happening because we are using the esc_html() function escape HTML on the page for added security.
To override this, at this time you will unfortunately have to create a customized version of the Additional Fields template in your theme.
This process is described in detail here → https://theeventscalendar.com/knowledgebase/themers-guide/
The quick version, however, is basically to just add the following directories and custom file in your theme:
{your parenttheme folder}/tribe-events/pro/modules/meta/additional-fields.phpAgain, see the full themer’s guide linked above for more information on that if necessary. But once you have this file made, make the file look like this: https://gist.github.com/ggwicz/12eb0eef4e145261e213
This change uses wp_kses_post() instead of esc_html(), which is still secure but will allow the link to render.
I’m sorry about all of this being required at this time to work around this…let me know if this helps!
— George
October 1, 2015 at 5:56 pm #1010725Christopher
ParticipantThat did the trick. Thank you so much!
October 2, 2015 at 5:06 am #1010811George
ParticipantAwesome! I’m sorry that, at this time, you have to go to such relatively large lengths to change such a relatively small detail, but we can definitely improve the handling of URL fields. And we will be 🙂 Stay tuned to plugin updates!
Best of luck with your site,
George -
AuthorPosts
- The topic ‘URL fields not rendering correctly’ is closed to new replies.
