Support

Account

Home Forums Add-ons Flexible Content Field How to reference a field when dynamically populating Select

Solved

How to reference a field when dynamically populating Select

  • Greetings,

    I have a select field preceded by a text field where user will enter a list of categories. I want the select field to be populated with the list the user entered.
    Both fields are at a specific menu under the layout of a flexible content field.

    The tutorial only references cases when data is pulled from Options:

    $choices = get_field('my_select_values', 'option', false);

    How do I reference a field from a sibling menu item?

    Also, the tutorial does not specifies where to put the code. I assumed in Functions.php correct?

    Thanks.

  • Hi @msoulam

    Yes, all filters are added to the functions.php file.

    It is not possible to populate a select field by it’s ‘sibling’ sub field values. I am assuming that when you say ‘menu item’, you are actually talking about a flexible content layout?

  • Hmmm. What about using WordPress built in categories. Can the Select field be populated with that?

  • Hi @msoulam

    Yes. Perhaps you could use the taxonomy field type?

    Thanks
    E

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

The topic ‘How to reference a field when dynamically populating Select’ is closed to new replies.