Home › Forums › Ticket Products › Eventbrite Tickets › Strip formatting from imported Eventbrite event
- This topic has 5 replies, 3 voices, and was last updated 9 years, 8 months ago by Barry.
-
AuthorPosts
-
April 3, 2014 at 12:00 pm #127578momondaysParticipant
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. 🙂
April 3, 2014 at 4:51 pm #127840BarryMemberGreat 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 🙂
April 7, 2014 at 1:32 pm #129117momondaysParticipantThanks 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.
April 8, 2014 at 10:14 am #129566BarryMemberExcellent!
April 22, 2014 at 1:01 pm #139854BillParticipant@momondays – encountering similar issue. Be interested if you were successful. Formatting of imported EB posts are horrible.
August 20, 2014 at 6:47 am #686198BarryMemberHi! 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!
-
AuthorPosts
- The topic ‘Strip formatting from imported Eventbrite event’ is closed to new replies.