I have a couple questions:
1. How do I access the GFFormsModel class from the front end to display form entries - when I try to access this in a shortcode function, it does not work (see code below)
2. How do I properly use the $search parameter on a specific form field (see code below)
When I run the function i have so far, the GFFormsModel::get_leads public function is not being calkled, and the $myLeads = 1 (no data array)
Please advise, thanks!
---
// shortcode to display current post's inquiries - used for front-end dashboard
add_shortcode( 'inquiries', 'ik_show_inquiries');
function ik_show_inquiries($atts) {
if($atts['ID']){
//now i want to get the form entries while searching for the Post ID
//shortcode $atts['ID'] - data was submitted in one of the form fields)
//$myLeads = RGFormsModel::get_leads(3, '', 'DESC', $atts['ID'], '0', $page_size='99999999');
$myLeads = GFFormsModel::get_leads(3, '', 'DESC', $atts['ID'], '0', $page_size='99999999');
}
//return print_r($myLeads);
if(is_array($myLeads)){
foreach($myLeads as $lead) {
$html .= print_r($lead)."<br>";
}
}
return $html;
}