Support

Account

Home Forums General Issues Pre-populating drop-down choices Reply To: Pre-populating drop-down choices

  • It would work the same say, but you’ll need to convert the value returned from the other plugins textarea to an array of choices. This is a basic example of the code you’d use in the load field filter:

    
    $values = get_value_from_kirki_toolkit(); // get the text value
    $values = explode(',', $values); // split the string into an array
    $values = array_map('trim', $values); // trim all the values
    foreach ($values as $value) {
      $field['choices'][$value] = $value;
    }
    return $field;