It is difficult to add an array of key value pairs to the choice options of a field when the value is numeric because it gets converted to the string label.
An example is setting a select field that list the gravity forms with the id as the value and the name as the label.
An array like this cant be added with the addChoice or addChoices or as the choices value in the select fields arg array. In all these cases the values are converted to match the labels.
The workaround for this is a little cumbersome because it breaks the chaining.
It is difficult to add an array of key value pairs to the choice options of a field when the value is numeric because it gets converted to the string label.
An example is setting a select field that list the gravity forms with the id as the value and the name as the label.
An array like this cant be added with the
addChoice
oraddChoices
or as thechoices
value in the select fields arg array. In all these cases the values are converted to match the labels.The workaround for this is a little cumbersome because it breaks the chaining.
Can we add a new method or an arg to prevent converting the numeric values to match the string?