Support

Account

Home Forums Backend Issues (wp-admin) ACF fields no longer under Field Groups. Reply To: ACF fields no longer under Field Groups.

  • @hube2 Strange, I was able to have both working side by side. The only requirement was I needed to export the fields any time I needed to make a change since the PHP took precedence. I think it was most likely a version wiping out my local copy I was using.

    Thanks for pointing me in the right direction I was able to get it working after use a small function to convert each of the field groups to a .json file.

    Here is the code for anyone in need of help:

    function acf_field_group_to_json($array) {
    
      $group = json_encode($array);
      echo '<p>Writing file to ' . $array['key'] . '.json</p>';
      $file = file_put_contents( $array['key'] . '.json', $group );
      if ($file) {
          echo "<p>". $file . " bytes file created.</p>";
      } else {
          '<p>Error, file not created.</p>';
      }
    }
    
    acf_field_group_to_json($array);

    Then you would refresh the page and it should generate the field group json file for you at the root of your project/server. A message will output to that page you refreshed in your project. You’d move these group field .json files into an acf-json folder in your theme folder and sync it up on the back-end.