Home Forums General Issues Cannot get data with get_field() Reply To: Cannot get data with get_field()

  • Sorry, let me start afresh as I mix the values above. The problem is the same though.

    I found these values in my database;

    meta_key fs_ski_resort_data_fs_email
    meta_value testabc
    meta_key _fs_ski_resort_data_fs_email
    meta_value field_647db09699751

    meta_key fs_ski_resort_data_osm_email
    meta_value test123
    meta_key _fs_ski_resort_data_osm_email
    meta_value field_64b3a3ad40bbf

    I have found that if I do (fs_ski_resort_data is a group name of id group_647d9f906d00a);

    $value1 = get_field(“fs_ski_resort_data_fs_email”, 2022 );
    $value2 = get_field(“fs_ski_resort_data_osm_email”, 2022 );

    I correctly get the result;

    $value1 = testabc
    $value2 = test123

    however, if I do;

    $value1 = get_field(“field_647db09699751”, 2022 );
    $value2 = get_field(“field_64b3a3ad40bbf”, 2022 );

    the result is;

    $value1 = [no value returned]
    $value2 = [no value returned]

    According to the documentation, it says;

    $selector (string) (Required) The field name or field key.

    So as far as I can see, a call like get_field(“field_647db09699751”, 2022 ); should work.

    Why doesn’t this work please?