I am working with a plugin that I use to sell tickets. It creates a post entry for the ticket, then adds more post entries for each custom field I collect data for and it sets the post_parent to the ticket ID. In a view, I can query the post table, and display the tickets sold, but when I try and get the field data via another query, I can't seem to get the post.ID from the outer loop into my args for the inner query. I have tried a few ways, but I get nothing, yet I know there is data in the database. Here is what I have tried:
{% for post in menuitems %}
{{ post.first_name }} {{ post.last_name }} {{ post.tc_ff_wouldyouconsideryourself_tcfn_4309 }} {{ post.owner_email }}<br />
{% set theID = post.ID %}
{% set args2 = {
post_type : 'tc_form_fields',
post_parent : post.ID ,
}
%}
{% set form_fields = mb.get_posts( args2 ) %}
{% for field in form_fields %}
{{ field.post_title }}: {{ field.post_content }}<br />
{% endfor %}
{% endfor %}
The second query gets nothing. I have also tried {{ post.ID }} and that actually trows an error. I have also tried to create a variable in the outer loop (it's still in the code), and pass the variable to args2, still did not work.
What am I missing?