Support

Account

Home Forums Backend Issues (wp-admin) Dynamicly loading options in nested select (acf/load_field/name=) not working

Solving

Dynamicly loading options in nested select (acf/load_field/name=) not working

  • I have an options page that is a sub page under woocommerce

    I have the following structure

    Product Rule (Repeater)
    – Product (Post Object returns ID)
    – Rules (Repeater)
    — Shipping Method (Multi Select)

    I am trying to dynamically populate the Shipping Method Select I have used the field_id and name but it doesn’t work.

    When I move the “Shipping Method Select” outside of all the repeaters it works.

    What am I doing wrong?

  • I solved my own problem about 10 minutes after posting this.

    this worked…

    acf/prepare_field/key=field_123

  • Yes, sub fields require using the field key because the field name includes the parent field name and the row index.

  • Yes but the change that seemed to work for me was when I switched from this hook…

    acf/load_field/key=

    to this hook…

    acf/prepare_field/key=

    load_field would work for items not nested, i have not done any digging though to fully understand the difference and why the change worked.

    Thank you John!!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.