Issue with stripping of HTML in tribe_events_get_the_excerpt

Home Forums Calendar Products Events Calendar PRO Issue with stripping of HTML in tribe_events_get_the_excerpt

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1112802
    Joel
    Participant

    In the file the-events-calendar\src\functions\template-tags\general.php

    there is a function, tribe_events_get_the_excerpt, that is stripping out the embedded HTML within my Event Post.
    I’d like to keep the formatting I’ve laid out, but there is a line of code that strips the HTML

    // Now we actually trim it
    $excerpt = wp_trim_words( $excerpt, $excerpt_length, $excerpt_more );

    Later in the code (a couple lines down), there is a call to
    // Remove “all” HTML based on what is allowed
    $excerpt = wp_kses( $excerpt, $allowed_html );

    but at this point, the variable $excerpt has already been stripped of the HTML, so the variable $allowed_html is not doing anything.

    Suggestions? Is there a fix?
    Apparently, I can’t setup an override to the general.php function “tribe_events_get_the_excerpt”, so I’ve been modifying the underlying code, but then this gets overwritten on the next update.

    What do you suggest?

    …joel

    #1113120
    Nico
    Member

    Hi Joel,

    Thanks for bringing this issue up! We are in fact aware of this and working on adding a new filter to the tribe_events_get_the_excerpt output so this default behavior can be changed.

    I also found this snippet in the bug report that might help you until the filter is added:

    https://gist.github.com/niconerd/e347c2c1e44698b97ecc1ef426acdc51

    Please give it a try and let me know if it works for now,
    Best,
    Nico

    #1119156
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Issue with stripping of HTML in tribe_events_get_the_excerpt’ is closed to new replies.