Hide shortcodes in imported events

Home Forums Calendar Products Event Aggregator Hide shortcodes in imported events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1361193
    Ville
    Participant

    Hi,

    I’m setting up a scheduled iCal import from another WordPress running Events Manager. The import works just fine, but there are shortcodes in the event body and the imported event shows those shortcodes as code (as can be expected). I’d like to remove/hide the [shortcode xyz=”123″] tags because in my calendar they are just junk code.

    The regex for removing the shortcodes is not an issue, here’s an example:
    https://stackoverflow.com/questions/32418336/php-remove-shortcodes-and-content-in-between-with-regex-pattern

    But is there a hook in the Event Aggregator that I could plug this code into? I don’t know how to do that. I’d really like to handle that properly and not through some temp file.

    regards,

    Ville

    #1362037
    Patricia
    Member

    Hey Ville,

    Thank you for reaching out to us!

    I do want to note that we are fairly limited in how much we can support custom development questions like this, but to help you get started, the files we use to handle imports are located on the-events-calendar/src/Tribe/Importer. I didn’t test it, but perhaps including this regex on File_Importer_Events.php would be a good option. We do have a list of recommended developers who could help you out with the code if you need it.

    There are also other (simpler) alternatives to achieve what you want: you can use a plugin like Say What? to replace all occurrences of [shortcode xyz=ā€123″] with an empty space. If your server is running with WP CLI, you can also set a cron to run a database search-replace every 30 minutes (or any time you want): if you choose this option and you have a linux server, I can help you writing the cron task.

    I hope this helps you get started! Let me know if you need anything else and I’ll be happy to assist!

    Best Regards,

    Patricia

    #1371717
    Ville
    Participant

    Hi Patricia,

    Thanks for your help. I actually found this plugin which allows regex search and replace without modifying any code:

    Real-Time Find and Replace


    With that it is trivial to get rid of the imported shortcodes.

    regards,

    Ville

    #1371756
    Patricia
    Member

    Hi Ville,

    That’s awesome! Glad to hear you found another option to get rid of these shortcodes. Thanks for sharing this alternative here šŸ™‚

    If you have any other questions at all please feel free to let me know and I’d be happy to help as best I can!

    Best regards,

    Patricia

    #1388153
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Hide shortcodes in imported events’ is closed to new replies.