Let Users Import their Facebook Events into Community Events
It would be cool if users submitting events through Community Events could input a Facebook URL and we import the rest with our Facebook Events plugin.
Due to recent changes in Facebook’s API, we can no longer import from Facebook. Sadly, there is nothing we can do about this unless they change their policies. And thus we also can’t pursue any Facebook-related feature requests. You can read more here: http://m.tri.be/1a5x
29 commentsComments are closed
Himanshu Tanna commented
Hi can somebody advice how/where to add the code from @Anselm
If we are using the Aggregator, will @Anselm’s customization work?
My community uses Meetup and FB, would like the ability for community(BuddyPress) to add this
I would love it too. Just simple "text area" where the user past his FB event. Bassically the same as is in the FB backend plugin.
I'm not a big coder, but so far this works for me:
/* PREPARATION */
/** @brief Handle a fb import error, prints a readable string for the user
to know why there was no success.
echo "<b>Fehler:</b> ";
/** @brief Process a successfull import, which means to depublish it(every
import must be checked by a admin) and send a mail to a admin to notify
him about the new event.
echo "Imported Facebook Event!<br />";
$new_data = array(
"ID" => $imported_event["event"],
"post_status" => "draft"
// for emails
wp_mail("firstname.lastname@example.org", "New Post", "Just check the wp backend");
/** @brief Get the FB Event ID from the submitted string.
/* USER INTERFACE */
<!-- Added for facebook import on Community Site -->
<h3>Facebook Veranstaltung importieren:</h3>
<p>Format: https://www.facebook.com/events/12345678/<br/>Die Veranstaltungen müssen manuell freigeschalten werden. Für einen automatischen Import von eurer Facebook-Seite setzen Sie sich bitte via <a href="http://domain.xx/impressum/">Kontaktformular</a> mit uns in Verbindung!</p>
<label for="community-fb-import-events-by-id">Facebook URL</label>
<input id="community-fb-import-events-by-id" name="community-fb-import-events-by-id" />
<input type="submit" id="community-fb-import-events-by-id-submit" value="Eintragen" />
// the data handling for the form, only if it was submitted
if( !empty($_POST["community-fb-import-events-by-id"]) )
// initialize the importer plugin
$imp = Tribe__Events__Facebook__Importer::instance();
// split fb id
$regex = "/facebook.com\\/events\\/([0-9]+)/i";
preg_match($regex, $_POST["community-fb-import-events-by-id"], $fb_match);
// get the fb id from the string inserted into the input field
$fb_id = parse_facebook_id($fb_match);
// kinda valid id was submitted
if($fb_id != -1)
// try to create the event
$res = $imp->create_local_event($fb_id);
// check success and error and handle it accordingly
<p>Die URL muss wie folgt aussehen: https://www.facebook.com/events/12345/</p>
<p>Bei Fehlern sind im Regelfall Einstellungen bei der Veranstaltungen (nur öffentliche Veranstaltungen können gelistet werden) oder bei in den Seiteneinstellungen (Sichtbarkeitsbeschränkungen sind zB. unzulässig) dafür verantwortlich.</p>
If you have Facebook importer and Community Evetns.
User can add Facebook events by Community Events. They don´t need to sign all in manually, just post a link and import. After import they should see all forms field before posting for example for changes.
Mick Pacholli commented
This and the ability to place into the correct calendar section would make this the MUST have plugin
I'm definitly on board for this! anything that makes adding events easier is a bonus. Organizers are already going to create events on FB. Having to re-input all that info manually may keep them off my site. +1 vote for this feature!
Thanks for all your helpful comments. Feel free to continue sharing.
it would be nice if users had a way to edit their events once I import from facebook. sometimes they change things on events & I'm not sure edits come over from fB
Sean Wiese commented
Sean Wiese commented
I would see the front end of this as part of the Community Events plugin, and it would allow existing event admins to create a new event from the FB event.
It would then pass to any existing moderation flow the Community Events plugin was setup for.
However, it may require both plugins to be installed for the processing of the event info itself. I think that is a reasonable expectation.
great idea. Most events are being created on FB first. We need users of our website to simply enter the URL or Event ID themselves
Brian Cruikshank commented
Please. Acro Maps has it, why can't Community Events? http://acromaps.com/post.html
Yasir, please share a visual mockup and/or a use case for such a feature to help us more fully understand this feature request. Thank you.
Yasir M Turk commented
I think this is already built in facebook events plugin but it just need an front-end interface
Yasir M Turk commented
I believe the logic is already in place to import the event data from event id using the administrator's fb auth session.. so frontend submission should have a field where users can submit an event id or url, which imports event data in the back-end when approved
Users should be able to click a button to retrieve their Facebook events and select ones they want to import into community events. This would save users form having to re-create events they've already put up on Facebook.
Make Facebook Importer available for Community Events, so users are the ones doing the import of their events apart from the possibility to manually create them.