Support

Account

Home Forums Add-ons Options Page using options page fields in functions.php Reply To: using options page fields in functions.php

  • Hi there! I think I’m having this problem too. I’m trying to set up a select field that’s dynamically populated from a repeater field on the Options page, pretty much exactly like this example:

    http://www.advancedcustomfields.com/resources/tutorials/dynamically-populate-a-select-fields-choices/#example-2

    Manually typing in select values, like so, works:

    $field['choices'][ 'test' ] = 'Testing 1';
    $field['choices'][ 'test2' ] = 'Testing 2';

    But attempting to reference the option field using get_field() doesn’t work.

    Edit: I originally tried calling add_filter() in functions.php, but, after some reading some posts here, then tried calling add_filter() inside an action on admin_init. I think the above code (manual choices) worked, but the option field values did not.