Support

Account

Forum Replies Created

  • @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.

  • @hube2 The Field Groups existed before everything was exported into PHP to include them into the project so they could be code versioned across different development workflow environments.

    I was expecting to migrate these to local JSON soon, but I can’t now because I can’t export anything with 0 field groups showing up. I used to have dozens of field groups with tons of fields setup in those groups.

    The PHP file still exists so the data is still working for the client for any current fields. Clearly something has changed (most likely a recent update) to eliminate all the existing field groups in the project.

    At this point I’m left wondering how I’m going to be able to easily make changes when I’m left with only the exported code to make those changes. It’s possible to still make changes via the API this way but that is pretty inefficient compared to the back-end UI built for handling the generation of UI components quickly.

  • I’m on version ACF Pro 5.4.5 plus WordPress 4.6.1 and I’m having the same issue.

    I’ve used the PHP method for adding ACF fields to a client project. Unfortunately the actual fields have disappeared from the back-end.

    Everything appears to still work because the PHP file is clearly getting activated but no fields are showing to edit within the field group settings.

Viewing 3 posts - 1 through 3 (of 3 total)