Hello
I am trying to setup forms to let users update their profiles from the website.
I have created ACF Choice List field called “hydraulik_acf” with 3 possible choices.
I think first step would require to create a form which contains these choices. Initialy I tried using checkox and putting some code in “options” with no result but After Daniele De Rosa suggestion on FB I decided to go checkbox wrapper and nested forms with query loop.
I made a
Pro Forms
Checkobx Wrapper
Checkbox (query loop)
In query editor I entered:
> $field_key = "hydraulik_acf"; // replace with your field key
> $field = get_field_object($field_key);
> $choices = array();
>
> if ($field) {
> foreach ($field['choices'] as $key => $value) {
> $choices[] = $key;
> }
> }
>
> return $choices;
I tried many different queries but none of them worked. Yet I dont know what to do further.
Could someone give me some hints on what I am doing wrong?
Unfortunatelly I am not advanced enough to understand this concept. The link you have provided gives examples of everything but getting ACF fiield available choices. I am trying hard with help of an AI, but I usually end up AI asking for a post type which is the dead end because I know how to query posts, pages, taxonomies but not field choices. I am still learning but this one overwhelmed me.
It turned out that my code snippet plugin did not work, so I was just trying to achieve different results without knowing it won’t work anyway.
Anyway I find it very complicated to understand bricks forge.
This has nothing to do with bricksforge. The Query Editor is a native Bricks feature which expects a specific format to work correctly. To use the Query Editor, some basic understanding of PHP and WordPress Queries is definitely recommended.