-
Notifications
You must be signed in to change notification settings - Fork 15
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
data entered in reusable group returns null #9
Comments
Unfortunately I haven't had time to write up any documentation for this plugin. Can you give me a specific example of what your setup is and I can try to test? There are definitely bugs when using this inside repeater fields and flexible content fields that I just haven't had time to fix, but I can try to take a look at what's happening and point you in the right direction. Or I'd happily accept a pull request if you find the bug on your own. |
Darn, I just deleted the group until someone can replicate it, and I didn't export the php :( But it's very simple: (despite the naming I used to get brains easier to digest it) I have a field group G1, that shows in a custom post type.
Reusable Group R1 is setup to show on an "option page" (so it doesn't show twice in my custom post type. I assume the "shows in" setting doesn't matter since reusable fields ARE designed to show somewhere else, right?)
When the post editor loads, I can see fields f1 and f2 correctly inside sub-field s2 in the right layout. I can save them and their values retrieve fine. Then in my template, all the fields are retrieved fine, as e.g. get_sub_field( name_of_G1-F1-L2-s2_here), but that returns null (properly inside the has_rows loop. Every other sub-field is working fine) Are they supposed to be retrieved rather as get_field() instead of "sub"? If the solution is to set the original group B as "show in" [the custom post type], and I DON'T want it to appear twice in the post editor, how should I hide the one outside the flexible content metabox? with CSS? JS? If this works I will re-create the 43 repeater fields I was working on, (it has actual content), copying from the current sub-field, to paste in the sub-field-reused-group-field if necessary, but I definitely like your plugin to group several fields inside the same table-column, rather than wasting space with one checkbox per column (so there's more room for the columns with a post editor in them) Thanks for your time. |
Some basic info/usage (code examples) as mentioned above would be great :) Struggling to get this plugin to work. |
A reusable group field used in a flexible content layout returns null when I dump the content of the repeater's sub-fields)
I haven't found documentation anywhere to retrieve the field's data. I just realized they could be designed to be retrieved as regular fields, not sub-fields.
Can anyone lead me to some documentation/support link?
Is it possible it returns null because the post type for the source fields group doesn't match the current post type? (Using the same one makes the group to appear twice in the post editor)
The text was updated successfully, but these errors were encountered: