Forum Replies Created

  • Hey James

    Thank you for helping me out. However I’m not sure I got everything right, we are talking about the selected choice’s valua/label pair and not the field’s label right?

    I tried to use the code in the example.

    If I use this for testing:

    $field = get_field_object('region');
      echo '<pre>';
      echo '</pre>';

    I still get this:

      array(2) {
        string(6) "purple"
        string(6) "purple"

    So it seems to me it records the value twice in the database?


    oh yeah, I forgot this, please keep in mind that my array got another level thanks to the opt group modification in the first post. So using the documentation’s example, my choices array looks like this for example:

      array(16) {
        ["UK - East"]=>
        array(6) {
          string(7) "Norfolk"
          string(7) "Suffolk"
          string(5) "Essex"
          string(13) "Hertfordshire"
          string(12) "Bedfordshire"
          string(14) "Cambridgeshire"

    So the “Display value and label” example won’t work here because it can’t find the actual label? So I guess this is a question of how to get the data here. Sorry I’m not a pro at PHP. Thank you in advance.

Viewing 1 post (of 1 total)