-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling PHP Generated Configs instead of dynamic #72
Comments
hi @JamiesonRoberts have you found a way around this? |
for anyone stumbling into this, you need to access acf field via the field type accessor method. instead of
you can do it via
|
I have been using https://github.com/superhuit-ch/wp-cli-acf-json for automatic syncs of the generated acf-json. The generated acf-json files are in git and whenever someone checks out the repository, they run |
@tbruckmaier definitely cool, though the main concern I have with this and the whole point of saving out the configs into PHP files rather than database driven is that it cuts down the number of queries required to generate the page. This makes TTFB faster overall, especially when you are dealing with complex systems. The JSON files are great for portability of updating configuration, but including configurations via the functions files is better for performance. |
@JamiesonRoberts yeah that's right, I ran into the same performance issues. You might want to check out my fork, I reworked the data fetching logic and it decreases the number of queries a lot (it takes the acf data directly from the post's meta data which is preloaded anyway). |
We are having the same issue, especially when trying to load in repeaters, the issue lies within the |
Meanwhile I have updated my fork to work with a php-generated config too: https://github.com/tbruckmaier/corcel-acf |
Myself and another developer have been bashing our heads against this code for the past day, and its due to how ACF under the hood handles post meta when the options are exported as PHP instead of being driven by the database and you are reading it in.
We work on a team of several devs and having to pass around configurations is incredibly frustration and also means we can't deal with things like programmatic updates for releasing via deployment tools.
The crux of it comes down to the following. When you generate the PHP options and load them via functions.php and ACF reads them in, ACF no longer creates posts in the wp_posts table, and exclusively creates them as post meta because it knows the mapping. Leveraging this configuration would be a huge performance boost for corcel as well as make for a far more ideal scenario for multi-developer projects.
Any ideas on how that could be accomplished?
The text was updated successfully, but these errors were encountered: