The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Events Manager
[resolved] Conflict with Advanced Custom Fields (11 posts)

  1. marsbidon
    Posted 3 years ago #


    I've a problem with Events manager and ACF (Advanced Custom Fields).
    I've added 3 custom fields to event post type.

    I want to post a new event (post-new.php?post_type=event), at this time the form is empty.
    I filled out all required fields (Title, date, time, category) and my 3 custom fields.

    Then I need to fill location fields.
    If I choose an existing location (with autocomplete) and publish the event, I'm redirected to event edit page (post.php?post=ID-of-my-new-event). All works fine : all fields are registered well.

    But if I create a new location at same time, when I publish the event I'm well redirected but my 3 custom fields are cleared to their default values or empty ! Nothing happens, any of them is registered. Then I must open the event and fill again my custom fields.

    I've tried on a clean wordpress with only events manager and acf.

    Any idea ? Where I can find any solution ?



  2. agelonwl
    Posted 3 years ago #

    do you a sample link and/or screenshots for us to see and analyze?

  3. marsbidon
    Posted 3 years ago #


    What do you want exactly?
    Could I give you an access to my dev site by mail to test?

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    actually, i don't think this is something we ourselves could look at (at least right now), given it's a pretty specific plugin conflict.

    my suggestion in the meantime is disable the auto-completer until we have more time to test stuff of this nature.

    one thing you could try... did you try adding these as #_ATT placeholders as well to your EM settings?

  5. marsbidon
    Posted 3 years ago #

    I can't disable auto-completer because of my client. He needs to create locations at the same time he creates events. (He don't want a dropdown of existing locations and having to create a location before)

    #_ATT placeholders won't match with one of my fields, I need to display a list of checkboxes as a single field. This is the reason why I've installed ACF.

    I searched a bit in the database and I noticed that my fields are partially registered.
    In the field 'event_attributes', there is only a:0:{} ...

    I've found nothing else to fix it at this time...

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    we're pretty busy at the moment working on core plugin features so looking into a plugin like ACF ourselves will take some time

  7. marsbidon
    Posted 3 years ago #

    of course...
    I'm sure this problem don't come from ACF but from EM because with any other custom post type, it works.
    And only in certain cases : when a new location is submitted at same time of event.
    Could you give me an idea of where I can find post location functions in EM (those which are implicated in event post) ?

  8. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    have you tried disabling Enable location attributes? in your Events > Settings > General > General

    maybe that's not helping

  9. marsbidon
    Posted 3 years ago #

    Yes I've tried this but it didn't fix my problem.
    I've spent a lot of time trying to use ACF correctly without any success.
    Now I use "Types" and it works better but I needed to customize your plugin's classes (em-event.php and em-location.php)
    save() and save_meta() functions seems to mix attributes, some are stored in EM_Event object and some in EM_Location object.
    I needed to move attribute from first object to second (or vice versa) like this :
    $this->get_location()->location_attributes['location_attribute_1'] = $this->event_attributes['location_attribute_1'];
    in save_meta() just under global $wpdb;
    With this, my attributes are well stored for location and not for event in post_meta table.

    Previously with ACF, it was the opposite : attributes was stored in EM_Location and not in EM_Event so in the database my attribute was stored in post_meta table with location post_id and not in em_events table in 'event_attributes' field.

    I hope it will help you find the problem ...

  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    given the time I'd have to spend messing with ACF, I can't help you further atm, given the other stuff we need to take care of first.

  11. Jean Goodwyn
    Posted 3 years ago #

    Hi mars!

    I see this is marked as resolved, so maybe you solved it - but just in case (and for anyone else having this problem who ends up here, like me)...

    I had the same problem, and here's how I solved it:

    1. Enable location custom fields in:
    Events » Settings » General » General Options » (Location Settings)

    2. In location templates, to call the contents of your ACF custom field, just call it like this: #_ATT{acf-field-name}

    This is a pain if you need to run the_content filter on the field — but if you don't need to, it should do what you want. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.