URL fields not rendering correctly

Home Forums Calendar Products Events Calendar PRO URL fields not rendering correctly

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1010485
    Christopher
    Participant

    Running 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?

    #1010486
    Christopher
    Participant

    The 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.

    #1010619
    George
    Participant

    Hey @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.php

    Again, 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

    #1010725
    Christopher
    Participant

    That did the trick. Thank you so much!

    #1010811
    George
    Participant

    Awesome! 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘URL fields not rendering correctly’ is closed to new replies.