Support

Account

Home Forums Front-end Issues How to add value to global fields ?

Helping

How to add value to global fields ?

  • hello guys.

    I’ve been looking for a long time. I understand how you can do it through the options page. But is it possible to somehow programmatically add new values to global field?

    Add value to field select here

  • Use the function

    
    $field = acf_get_field($field_key);
    

    to get the field
    add new choices to `$field[‘choices’];
    then

    
    acf_update_field($field);
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.