Skip to content
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

Fix recursion in ACF fields with GravityView shortcodes #1998

Conversation

doekenorg
Copy link
Contributor

This PR adresses #1812.

It looks like a recursion is going on when trying to retrieve the meta fields for a post. It used the get_field_objects() method of ACF. Apparently they are right when they say:

The function is not very elegant and wastes a lot of PHP memory / SQL queries if you are not using all the fields / values

So I've replaced it with half the internal method, retrieving the meta keys for ACF only, and microcaching the result.

This fixes the recursion for me, and I'm able to show the view when rendering the_field('content');.

@doekenorg doekenorg self-assigned this Feb 28, 2024
@zackkatz zackkatz merged commit 31916de into develop Feb 29, 2024
1 check passed
@zackkatz zackkatz deleted the issue/1812-the-gravityview-shortcode-doesnt-work-when-embedded-inside-an-acf-wysiwyg-block branch February 29, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants