Problem: We have one repeatable field group (RFG) that contains another nested RFG. We would like to build a nested array in PHP that contains information from the nested RFG structure, but we are not able to access custom field values in the nested RFG using the toolset_get_related_posts API and get_post_meta.
Solution: In this case the inner, nested toolset_get_related_posts API call must be updated to query by the current outer RFG's post ID as opposed to querying by the ID of the post containing the RFGs. In the case of the outer RFG, querying by the ID of the post is appropriate, but in the case of the inner RFG, you should query by the ID of the outer RFG since the post relationship is technically established between the two RFGs.
Problem: I have a View of posts in which I have nested another View of taxonomy terms. I would like to filter the View of taxonomy terms so that only those terms applied to the current post in the loop are displayed. If no terms are found associated with the current post in the loop, that post should not be displayed in the results.
Solution: Use the legacy View editor to create and manage nested Views, since this feature is not supported in the Block editor. In the inner nested View, add a taxonomy term Query Filter that filters by the current post. In the Loop Editor, insert the wpv-taxonomy-title shortcode in the loop to display the term title, or use other shortcodes to display other information like the term slug, term archive link, or custom term fields. Include information about the parent post in the wpv-items-found section using shortcodes, but do not place parent post shortcodes inside the wpv-loop tags. Anything in the wpv-loop tags will be repeated for each matching term.
Problem: I have a nested View structure where the outer View shows posts and the inner View shows terms from a hierarchical taxonomy. The nested inner View should be filtered so that only the terms associated with each post in the outer View loop are displayed in the inner View. I would also like to hide any terms that have hierarchical parent terms.
Solution: Use two filters in the nested View. One Query Filter should be based on the term parent, where the term parent is None. This will show only top-level terms from the hierarchy. The other Query Filter should be based on the taxonomy term, and should be set by the current post. This will hide unrelated terms from each nested View.