• Hello, I use this plugin to create bidirectional fields.

    For example I have a field “Sessions” and a field “Games”.

    Now I use a date field under Sessions that I have named “session_date”.

    Is it possible to sync the date I have entered in sessions with the field “game_date” I have created under games?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I think there is misunderstanding of what bi-directional setting means in ACF Extended. This setting is meant to link together two “relational” field types, like post object or post relationship. Once setup, when one relational field get updated, it will add the current value to the other-side field.

    In your case, you try to setup a bidirectional setting on a “Date” field, which doesn’t really makes sense, because you cannot know which post it should update. That’s why you cannot set the ACF Extended bidirectional setting on a date field.

    From what I understood, you’ll have to write custom PHP code in order to make your logic work.

    May I ask you a more detailed structure of your fields? Here is an example:

    – Post Type: Session
    — Post: Session A

    Field 1: Games (field type: post object / post type: Games)
    Field 2: session_date (field type: date)

    – Post Type: Game
    — Post: Game A

    Field 1: session_date (type: date)

    – Logic:

    On [Post:Session A], when user select the post “Game A” in [Field:Games] and then enter a date in [Field:session_date] and save the post, I want to update [Field:session_date] on the [Post:Game A] which the [Post:Session A] [Field:session_date] value.

    In this scenario, you’ll have to use acf/save_post action, at a priority of 20, in order to retrieve field data and update the targeted field with the correct value.

    You can find more informations about this hook here: https://www.advancedcustomfields.com/resources/acf-save_post/

    Hope it helps!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Sync Date Value’ is closed to new replies.