Support » Plugin: Events Manager » [Plugin: Events Manager] Conflict with Advanced Custom Fields

  • Resolved marsbidon



    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 ?


Viewing 10 replies - 1 through 10 (of 10 total)
  • do you a sample link and/or screenshots for us to see and analyze?


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

    Plugin Author Marcus


    NetWebLogic Support

    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?

    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…

    Plugin Author Marcus


    NetWebLogic Support

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

    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) ?

    Plugin Author Marcus


    NetWebLogic Support

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

    maybe that’s not helping

    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 …

    Plugin Author Marcus


    NetWebLogic Support

    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.

    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. 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Events Manager] Conflict with Advanced Custom Fields’ is closed to new replies.