Apply event categories after FB event import

Home Forums Calendar Products Event Aggregator Apply event categories after FB event import

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #998245
    Jacob
    Participant

    Hello team!

    I’d like to know if it is technically possible to apply my event categories to imported fb events? I am not referring to importing categories form fb, I know that’s not possible due to the FB api.

    The Tribe import setting should allow to define one or many categories for each FB page ID so that after each event import that category is applied.

    Can I do this with php hooks?

    Best wishes,
    Jacob

    #998454
    Brian
    Member

    Hi Jacob,

    Thanks for using our plugins. I can help out.

    Currently, there is no hooks in the plugin to do this and the WordPress hooks for saving a post run to early to be able to target the Facebook Events Only.

    I did find a hook that runs when a custom field is added. So I created a hook to run and if the meta field equals facebook-importer it will add an event category.

    This hook though runs everytime a custom field is created so it is not ideal, but seems to be working correctly for manual and auto imports.

    https://gist.github.com/jesseeproductions/bba4f0e18bbef5171531

    Replace the 20 with the event category you would like to set it too.

    Let me know how that works out.

    Thanks

    #998638
    Jacob
    Participant

    Hello Brian,

    Oha, that is very interesting. I will check it out. What kind of actions technically count as the creation of a custom field? I have just little coding expertise yet. Hope the question doesnt sound too stupid 🙂

    After pasting the code into my functions.php, does it run automatically after each automatic fb event import?

    Yours
    Jacob

    #998782
    Brian
    Member

    Hi Jacob,

    It should run on an automatic fb event import.

    I tested on my site and it worked for me.

    If you create a new custom field for a post it should hook to that.

    If you update an existing custom field it should not run.

    Also, if it finds an event category it will not add a default one. It is looking for a specific field in the imported facebook events so it should not add a category to any other events either.

    Cheers

    #999301
    Jacob
    Participant

    Hello Brian,

    I am testing it now. I get no category applied when i use the manual fb event import by event ID. Do you have a hint?

    Would it be custom work to modify the code so that I get a result like:
    FB page A -> category #1 is applied to the events imported
    FB page B -> category #2 is applied to the events imported
    FB page C -> category #3 is applied to the events imported
    and
    FB page D -> category #1 is applied to the events imported

    Or is this a fast forward code modification you can give me?

    Best wishes,
    Jacob

    #999309
    Brian
    Member

    Sorry it was working for me I would check your Event Category ID, but beyond that I cannot troubleshoot a customization.

    And it is not possible to use the coding I provided to give a category based on a Facebook Page as that information is not saved with the event it just saves the Events Facebook ID.

    Unfortunately, that is all I have for this and the only other method to get this would be to modify the Facebook Plugin Directly.

    #999813
    Jacob
    Participant

    Hey Brian,

    Thank you for your assistance. I will check out the user voice area if that feature is present and vote for it.

    Best wishes,
    Jacob

    #999884
    Brian
    Member

    Sorry I could not help more.

    Please upvote the feature though so we can push to get it in the plugin.

    I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Apply event categories after FB event import’ is closed to new replies.