Strip formatting from imported Eventbrite event

Home Forums Ticket Products Eventbrite Tickets Strip formatting from imported Eventbrite event

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #127578
    momondays
    Participant

    We run a site with many users, who create events on Eventbrite (and then we import them). Many of the users are not good with HTML or formatting in general, and their events get imported with a ton of inline styling – spans, etc – as well as p tags. We have to go through and remove all of these so the event displays properly on our site.

    Is there code we can add, or any way we can strip formatting from events when we import them from Eventbrite? Other than doing it manually. 🙂

    #127840
    Barry
    Member

    Great question.

    Yes, it’s possible – but we’d need to leave the implementation to you. In rough outline though I think the sort of approach I might take here is:

    • If an event is imported, the processes that handle the import are triggered during the admin_init action – you could use this same hook to get some code in place before our own import routine starts
    • When the event is created it uses some of our own code which basically acts as a wrapper around wp_insert_post() … because it’s just a thin wrapper there is nothing to prevent you from further leveraging WordPress’s own hooks like save_post (or something more specific even, such as save_post_tribe_events) to modify the newly created post
    • Both WordPress and PHP itself have various capabilities you could leverage to strip out unwanted formatting

    I hope that gives you a possible “angle of attack” here – though there are probably a number of different ways you could tackle this, too – and good luck 🙂

    #129117
    momondays
    Participant

    Thanks Barry – I will see what I can do! If/when I manage to accomplish this, I’ll update this thread so other people can find it.

    #129566
    Barry
    Member

    Excellent!

    #139854
    Bill
    Participant

    @momondays – encountering similar issue. Be interested if you were successful. Formatting of imported EB posts are horrible.

    #686198
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Strip formatting from imported Eventbrite event’ is closed to new replies.