Exclude event description from export

Home Forums Calendar Products Events Calendar PRO Exclude event description from export

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1110458
    Marcial
    Participant

    Hi there
    We have a lot of text in the event descriptions as well as two shortcodes. When exporting an event to a calendar like Outlook, it also copies the shortcodes. Thats not very pretty. For us, it would be fine if we could exclude everything in the textfield from the export, so it only exports the name, date and venue of the event.
    Is that possible? I don’t think I missed something in the settings. Deleting one or two codes of PHP would be an accebtable solution for us (event tough its not update-save).
    Thanks for the help!
    Best,
    Marcial

    #1110772
    Andras
    Keymaster

    Hi Marcial,

    Thanks for reaching out! Let me try to help you with this one. I might have a solution which you will not lose with an update. 🙂

    Paste this code in your functions.php file (Appearance > Editor > choose functions.php on the right side):


    function pos_ical_remove_description( $parts ) {
    foreach ( $parts as &$single_part ) {
    // We're only interested in modifying the description field
    if ( 0 !== strpos( $single_part, 'DESCRIPTION' ) ) continue;
    $single_part = "DESCRIPTION:";
    }
    return $parts;
    }
    add_filter( 'tribe_ical_feed_item', 'pos_ical_remove_description' );

    This will basically make the description field empty, so it will not show up in the exported iCal file.

    Let me know if this helps solve your problem!

    Cheers,
    Andras

    #1112039
    Marcial
    Participant

    Hi Andras

    Thank you for your solution. That works fine!

    Best,
    Marcial

    #1112704
    Geoff
    Member

    Excellent! Thanks for confirming that Marcial and please feel free to let us know if anything else pops up–we’d be happy to help. 🙂

    Cheers,
    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Exclude event description from export’ is closed to new replies.